<?php


header("Content-type:text/html;charset=utf-8");
/** 赢彩网 开奖结果出来后  投注结算 **/
set_time_limit(0);
date_default_timezone_set("PRC");
include('./db_config.php');

//1.连接数据库->pdo方式
$db_pdo_link = pdo_write_read_link();  //定义为全局变量

if(!$db_pdo_link)
{
	die('pdo connection failed!');
}

$OPENTIME=TIME();

//取出未结算的投注注单  每次循环最多执行3000条 
$ALL_WEIJS=$db_pdo_link->query("SELECT * FROM kkty_touzhu_list_no where czid!=62 limit 3000")->fetchAll(PDO::FETCH_ASSOC);

FOREACH($ALL_WEIJS  AS $TZ){   
	 
	 $QKJJG=$db_pdo_link->query("SELECT * FROM kkty_kjjg_list WHERE czid={$TZ['czid']} AND qihao='".$TZ['qihao']."'")->fetch(PDO::FETCH_ASSOC);

	 IF($QKJJG['kjjg']>0){
		 //时时彩未上的彩种 '2','3','6','11','12','52','53','54'
		 //快3未上的彩种 '37','38','39','40','41','42','43','45','46','47','57'
		 //11选5未上的彩种 '13','14','15','16','17','18','19','20','21','22','23','24','26','27','29','31','32','33','34','35','58'
		 //时时乐未上的彩种 '5','7',
		 
		 $SSC_ARRAY = ['1','8'];  //【重庆(赢彩)时时彩,天津时时彩】	 
		 $KUAISAN_ARRAY = ['36','44'];  //【安徽快3,江苏快3】
		 $SHIYIXUANWU_ARRAY = ['16','25','28'];  //【江西11选5,山东11选5,广东11选5】
		 //$KUAILESF_ARRAY = ['49','59','62']; //【广东快乐10分,重庆快乐10分,天津快乐10分】
		 $SSL_ARRAY = ['5','7','48']; //【排列3,福彩3d,上海时时乐】
		 
		 //时时彩
		 IF(in_array($TZ['czid'],$SSC_ARRAY))
		 { 
			 $vip_account_result = SSC_TOUZHUJIESUAN($TZ['id'],$QKJJG['kjjg']);
			 
		 }

		 //快3
		 IF(in_array($TZ['czid'],$KUAISAN_ARRAY))
		 {
			 
			 $vip_account_result =KUAISAN_TOUZHUJIESUAN($TZ['id'],$QKJJG['kjjg']);
			 
		 }

		 //11选5
		 IF(in_array($TZ['czid'],$SHIYIXUANWU_ARRAY))
		 {
			 
			 $vip_account_result =SHIYIXUANWU_TOUZHUJIESUAN($TZ['id'],$QKJJG['kjjg']);
			 
		 }

		 //pc蛋蛋
		 IF($TZ['czid']=='10')
		 {
			 
			 $vip_account_result =PCDD_TOUZHUJIESUAN($TZ['id'],$QKJJG['kjjg']);
			 
		 }

		 //pk10  幸运飞艇61   三分赛车【|| $TZ['czid']==56  三分赛车未开】
		 IF($TZ['czid']=='4' || $TZ['czid']=='61')  
		 {
			 $vip_account_result =PK10_TOUZHUJIESUAN($TZ['id'],$QKJJG['kjjg']);
			 
		 }
/* 
		 //快乐10分
		 IF(in_array($TZ['czid'],$KUAILESF_ARRAY))
		 {
			 $vip_account_result =GDKLS_TOUZHUJIESUAN($TZ['id'],$QKJJG['kjjg']);
		 }
 */
		 //时时乐
		 IF(in_array($TZ['czid'],$SSL_ARRAY))
		 {
			 
			 $vip_account_result =SHSSL_TOUZHUJIESUAN($TZ['id'],$QKJJG['kjjg']);
			 
		 }

		 //七星彩
		 IF($TZ['czid']=='51')
		 {
			 
			 $vip_account_result =QIXINGCAI_TOUZHUJIESUAN($TZ['id'],$QKJJG['kjjg']);
			 
		 }

		 //六合彩
		 IF($TZ['czid']=='9')
		 {
			 
			 $vip_account_result = LHC_TOUZHUJIESUAN($TZ['id'],$QKJJG['kjjg']);
			 
		 }
/* 		 
		 //北京快乐8 
		 if($TZ['czid']=='60')
		 {
			$vip_account_result = KL8_TOUZHUJIESUAN($TZ['id'],$QKJJG['kjjg']);
		 }
*/
		 //用户正常结算后再结算有代理的情况	
		 if($vip_account_result)
		 {
			 DAILIJIESUAN($TZ['username'],$TZ['tzje']-$TZ['fdje'],$TZ['qihao'],$TZ['czid']);
		 }
		 
		 
	 }
	 
	 
}

//北京快乐8投注注单结算公共类

//------------------------------北京快乐8[已和前台玩法对比]----------------------------------------------------//

function KL8_TOUZHUJIESUAN($TZID,$KJJG){
    global $db_pdo_link;
    $OLD_TZ = $db_pdo_link->query("SELECT * FROM kkty_touzhu_list_no WHERE id={$TZID}")->fetch(PDO::FETCH_ASSOC);
    if($OLD_TZ['wfid'] > 0) {
        $WFNAME = $db_pdo_link->query("SELECT * FROM kkty_peilv WHERE id={$OLD_TZ['wfid']}")->fetch(PDO::FETCH_ASSOC);
    } else {	
        $WFNAME = $db_pdo_link->query("SELECT * FROM kkty_peilv WHERE wanfa='{$OLD_TZ['tzhm']}'")->fetch(PDO::FETCH_ASSOC);	
    }

    $ZJZS = 0;
    $up = 0;
    $down = 0;
    $kjjg_arr = str_split($KJJG,2);
    $kjjg_sum = array_sum($kjjg_arr);
    $tzhm_arr = explode(' ',$OLD_TZ['tzhm']);
    $tmp_arr = array_intersect($tzhm_arr,$kjjg_arr);
    
    if($WFNAME['wanfa'] == '任选一') {
        if(in_array($OLD_TZ['tzhm'],$kjjg_arr)) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '任选二') {
        if($tmp_arr == $tzhm_arr) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '任选三') {
        if($tmp_arr == $tzhm_arr) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '任选四') {
        if($tmp_arr == $tzhm_arr) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '任选五') {
        if($tmp_arr == $tzhm_arr) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '任选六') {
        if($tmp_arr == $tzhm_arr) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '任选七') {
        if($tmp_arr == $tzhm_arr) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '和值单双') {
        if(($kjjg_sum%2==0) && (strpos($OLD_TZ['tzhm'],'双')!==false)) $ZJZS = 1;
        if(($kjjg_sum%2!=0) && (strpos($OLD_TZ['tzhm'],'单')!==false)) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '和值大') {
        if(($kjjg_sum>810) && (strpos($OLD_TZ['tzhm'],'大')!==false)) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '和值和') {
        if(($kjjg_sum==810) && (strpos($OLD_TZ['tzhm'],'和')!==false)) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '和值小') {
        if(($kjjg_sum<810) && (strpos($OLD_TZ['tzhm'],'小')!==false)) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '和值大小单双') {
        if(($kjjg_sum>810) && ($kjjg_sum%2==0) && (strpos($OLD_TZ['tzhm'],'大双')!==false)) $ZJZS = 1;
        if(($kjjg_sum>810) && ($kjjg_sum%2!=0) && (strpos($OLD_TZ['tzhm'],'大单')!==false)) $ZJZS = 1;
        if(($kjjg_sum<810) && ($kjjg_sum%2==0) && (strpos($OLD_TZ['tzhm'],'小双')!==false)) $ZJZS = 1;
        if(($kjjg_sum<810) && ($kjjg_sum%2!=0) && (strpos($OLD_TZ['tzhm'],'小单')!==false)) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '上下盘上') {
        foreach($kjjg_arr as $v) {
            if($v >= 41) $tmp_1++;
            if($v <= 40) $tmp_2++;
        }
        if($tmp_1 < $tmp_2) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '上下盘中') {
        foreach($kjjg_arr as $v) {
            if($v >= 41) $tmp_1++;
            if($v <= 40) $tmp_2++;
        }
        if($tmp_1 == $tmp_2) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '上下盘下') {
        foreach($kjjg_arr as $v) {
            if($v >= 41) $tmp_1++;
            if($v <= 40) $$tmp_2++;
        }
        if($tmp_1 > $tmp_2) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '奇偶盘奇') {
        foreach($kjjg_arr as $v) {
            if($v%2 == 0) $tmp_1++;
            if($v%2 != 0) $tmp_2++;
        }
        if($tmp_1 < $tmp_2) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '奇偶盘偶') {
        foreach($kjjg_arr as $v) {
            if($v%2 == 0) $tmp_1++;
            if($v%2 != 0) $tmp_2++;
        }
        if($tmp_1 > $tmp_2) $ZJZS = 1;
    }
    
    if($WFNAME['wanfa'] == '奇偶盘和') {
        foreach($kjjg_arr as $v) {
            if($v%2 == 0) $tmp_1++;
            if($v%2 != 0) $tmp_2++;
        }
        if($tmp_1 == $tmp_2) $ZJZS = 1;
    }
    
    
    //结算中奖金额并且删除投注数据表转移到已结算表
    //定义试玩账号和内部账号  区分写入表
    $USER_CL=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='{$OLD_TZ['username']}'")->fetch(PDO::FETCH_ASSOC);
    
    if($USER_CL['nbzh']==1 || $USER_CL['swzh']==1) {
        $MYSQL_NAME="kkty_touzhu_list_sw";
    } else {
        $MYSQL_NAME="kkty_touzhu_list_ok";
    }
    
    //取出中奖金额
    if($OLD_TZ['nbzh']==1) $TZMS_LH=1;
    if($OLD_TZ['nbzh']==2) $TZMS_LH=10;
    if($OLD_TZ['nbzh']==3) $TZMS_LH=100;
    
    //中奖金额算法注释   投注赔率 除以2 乘以单注金额 乘以 中奖注数 除以 投注模式 （赔率*单注金额*中奖注数/投注模式）
    $ZJJE=$OLD_TZ['dqpl']*$OLD_TZ['dzje']*$ZJZS/$TZMS_LH;
    $ZJJE = sprintf('%.2f',$ZJJE);
    
    //转移投注注单
    $MYSQL_ZHIXING_YUJU_A="`id`,`czid`,`qihao`,`tzhm`,`tzje`,`dzje`,`tzzs`,`username`,`tzhje`,`zjje`,`ifqs`,`wfid`,`dqpl`,`xzfd`,`fdje`,`kjjg`,`zjzs`,`nbzh`,`tz_time`";
    $MYSQL_ZHIXING_YUJU_B="'".$OLD_TZ['id']."','".$OLD_TZ['czid']."','".$OLD_TZ['qihao']."','".$OLD_TZ['tzhm']."','".$OLD_TZ['tzje']."','".$OLD_TZ['dzje']."','".$OLD_TZ['tzzs']."','".$OLD_TZ['username']."','".$OLD_TZ['tzhje']."','{$ZJJE}','1','".$OLD_TZ['wfid']."','".$OLD_TZ['dqpl']."','".$OLD_TZ['xzfd']."','".$OLD_TZ['fdje']."','{$KJJG}','{$ZJZS}','".$OLD_TZ['nbzh']."','".$OLD_TZ[tz_time]."'";

    try {
        $db_pdo_link->beginTransaction();
        $db_pdo_link->exec("INSERT INTO `{$MYSQL_NAME}` ($MYSQL_ZHIXING_YUJU_A) VALUES ($MYSQL_ZHIXING_YUJU_B)");
        $db_pdo_link->exec("DELETE FROM `kkty_touzhu_list_no` WHERE id={$TZID}");
        	
        //判断中奖金额大于0.001 大于的话给用户增加金额
        if($ZJJE>0.001) {
            $db_pdo_link->exec("UPDATE kkty_username SET `je`=`je` + '{$ZJJE}',`zjzje`=`zjzje`+'{$ZJJE}' WHERE id={$USER_CL['id']}");
        }
        
        //发送消息
        $CZNMSD=$db_pdo_link->query("SELECT * FROM kkty_caipai_list WHERE id={$OLD_TZ['czid']}")->fetch(PDO::FETCH_ASSOC);
        	
        if($CZNMSD['cp_name_new']=="") $CZNMSD['cp_name_new']=$CZNMSD['cp_name_old'];
        	
        USER_FASONG($USER_CL['username'],"您投注的彩种：【{$CZNMSD['cp_name_new']}】第：【{$OLD_TZ['qihao']}】已开奖，中奖金额：【{$ZJJE}】元！");
    
        $db_pdo_link->commit();
        return true;
    } catch(PDOException $e) {
        $db_pdo_link->rollBack();
        return false;
    }
}


//六合彩投注注单结算公共类

//------------------------------香港六合彩[已和前台玩法对比]----------------------------------------------------//

FUNCTION LHC_TOUZHUJIESUAN($TZID,$KJJG){
	 
	 GLOBAL $db_pdo_link;
	 
	 $OLD_TZ=$db_pdo_link->query("SELECT * FROM kkty_touzhu_list_no WHERE id={$TZID}")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($OLD_TZ['wfid']>0)
	 {
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_play_classify WHERE id={$OLD_TZ['wfid']}")->fetch(PDO::FETCH_ASSOC);
		 
	 }ELSE
	 {
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_peilv WHERE wanfa='{$OLD_TZ['tzhm']}'")->fetch(PDO::FETCH_ASSOC);
		 
	 }
	 
	 $KJJG_1=SUBSTR($KJJG,0,2);
	 
	 $KJJG_2=SUBSTR($KJJG,2,2);
	 
	 $KJJG_3=SUBSTR($KJJG,4,2);
	 
	 $KJJG_4=SUBSTR($KJJG,6,2);
	 
	 $KJJG_5=SUBSTR($KJJG,8,2);
	 
	 $KJJG_6=SUBSTR($KJJG,10,2);
	 
	 $KJJG_7=SUBSTR($KJJG,12,2);
	 
	 $KJJG_8=array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4,$KJJG_5,$KJJG_6);
	 $KJJG_TX = array(
		 	'牛'=>array('10','22','34','46'),
		 	'兔'=>array('08','20','32','44'),
		 	'龙'=>array('07','19','31','43'),
		 	'马'=>array('05','17','29','41'),
		 	'猴'=>array('03','15','27','39'),
		 	'猪'=>array('12','24','36','48')
	 );
	 $KJJG_DX = array(
	 		'鼠'=>array('11','23','35','47'),
	 		'虎'=>array('09','21','33','45'),
	 		'蛇'=>array('06','18','30','42'),
	 		'羊'=>array('04','16','28','40'),
	 		'鸡'=>array('02','14','26','38'),
	 		'狗'=>array('01','13','25','37','48')
	 );
	 $KJJG_JQ = array(
	 		'牛'=>array('10','22','34','46'),
	 		'马'=>array('05','17','29','41'),
	 		'蛇'=>array('06','18','30','42'),
	 		'鸡'=>array('02','14','26','38'),
	 		'狗'=>array('01','13','25','37','48'),
	 		'猪'=>array('12','24','36','48')
	 );
	 $KJJG_YS = array(
	 		'鼠'=>array('11','23','35','47'),
	 		'虎'=>array('09','21','33','45'),
	 		'兔'=>array('08','20','32','44'),
	 		'龙'=>array('07','19','31','43'),
	 		'蛇'=>array('06','18','30','42'),
	 		'猴'=>array('03','15','27','39')
	 );
	 $KJJG_QX = array(
	 		'鼠'=>array('11','23','35','47'),
	 		'牛'=>array('10','22','34','46'),
	 		'虎'=>array('09','21','33','45'),
	 		'兔'=>array('08','20','32','44'),
	 		'龙'=>array('07','19','31','43'),
	 		'蛇'=>array('06','18','30','42')
	 );
	 $KJJG_HX = array(
	 		'马'=>array('05','17','29','41'),
	 		'羊'=>array('04','16','28','40'),
	 		'猴'=>array('03','15','27','39'),
	 		'鸡'=>array('02','14','26','38'),
	 		'狗'=>array('01','13','25','37','48'),
	 		'猪'=>array('12','24','36','48')
	 );
	 $KJJG_ZH = $KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5+$KJJG_6+$KJJG_7;
	 
	 if($WFNAME['class_name_mini'] == "两面"){
	 	if($OLD_TZ['tzhm'] == "特单" && $KJJG_7%2==1){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if($OLD_TZ['tzhm'] == "特双" && $KJJG_7%2==0){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if($OLD_TZ['tzhm'] == "特大" && $KJJG_7>=25 && $KJJG_7<49){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if($OLD_TZ['tzhm'] == "特小" && $KJJG_7>=1 && $KJJG_7<25){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if($OLD_TZ['tzhm'] == "特合大" && substr($KJJG_7,0,1)+substr($KJJG_7,1,1)>=7){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if($OLD_TZ['tzhm'] == "特合小" && substr($KJJG_7,0,1)+substr($KJJG_7,1,1)<=6){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if($OLD_TZ['tzhm'] == "特合单" && (substr($KJJG_7,0,1)+substr($KJJG_7,1,1))%2==1){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if($OLD_TZ['tzhm'] == "特合双" && (substr($KJJG_7,0,1)+substr($KJJG_7,1,1))%2==0){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if($OLD_TZ['tzhm'] == "特尾大" && substr($KJJG_7,1,1)>=5){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if($OLD_TZ['tzhm'] == "特尾小" && substr($KJJG_7,1,1)<=4){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if ($OLD_TZ['tzhm'] == "特天肖") {
	 		foreach ($KJJG_TX as $v){
	 			if(in_array($KJJG_7,$v)){
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if ($OLD_TZ['tzhm'] == "特地肖") {
	 		foreach ($KJJG_DX as $v){
	 			if(in_array($KJJG_7,$v)){
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if ($OLD_TZ['tzhm'] == "特前肖") {
	 		foreach ($KJJG_QX as $v){
	 			if(in_array($KJJG_7,$v)){
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if ($OLD_TZ['tzhm'] == "特后肖") {
	 		foreach ($KJJG_HX as $v){
	 			if(in_array($KJJG_7,$v)){
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if ($OLD_TZ['tzhm'] == "特家肖") {
	 		foreach ($KJJG_JQ as $v){
	 			if(in_array($KJJG_7,$v)){
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if ($OLD_TZ['tzhm'] == "特野肖") {
	 		foreach ($KJJG_YS as $v){
	 			if(in_array($KJJG_7,$v)){
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if ($OLD_TZ['tzhm'] == "总单" && $KJJG_ZH%2==1) {
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if ($OLD_TZ['tzhm'] == "总双" && $KJJG_ZH%2==0) {
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if ($OLD_TZ['tzhm'] == "总大" && $KJJG_ZH>=175) {
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if ($OLD_TZ['tzhm'] == "总小" && $KJJG_ZH<=174) {
	 		$ZJZS=$ZJZS+1;
	 	}
	 	
	 }
	 if($WFNAME['class_name_mini'] == "特码"){
	 	IF($OLD_TZ['tzhm']=="01"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="02"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="03"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="04"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="05"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="06"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="07"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="08"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="09"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="10"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="11"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="12"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="13"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="14"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="15"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="16"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="17"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="18"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="19"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="20"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="21"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="22"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="23"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="24"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="25"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="26"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="27"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="28"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="29"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="30"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="31"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="32"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="33"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="34"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="35"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="36"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="37"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="38"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="39"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="40"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="41"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="42"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="43"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="44"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="45"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="46"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="47"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="48"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="49"){
	 			
	 		IF(FLOOR($OLD_TZ['tzhm'])==FLOOR($KJJG_7)){$ZJZS=$ZJZS+1;}
	 			
	 	}
	 }
	 if($WFNAME['class_name_mini'] == "正码"){
	 	IF($OLD_TZ['tzhm']==$KJJG_1){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']==$KJJG_2){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']==$KJJG_3){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']==$KJJG_4){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']==$KJJG_5){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']==$KJJG_6){$ZJZS=$ZJZS+1;}
	 }
	 if($WFNAME['class_name_mini'] == "正一特"){
	 	IF($OLD_TZ['tzhm']=="01"){
	 	
	 		IF($KJJG_1=="01"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="02"){
	 	
	 		IF($KJJG_1=="02"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="03"){
	 	
	 		IF($KJJG_1=="03"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="04"){
	 	
	 		IF($KJJG_1=="04"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="05"){
	 	
	 		IF($KJJG_1=="05"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="06"){
	 	
	 		IF($KJJG_1=="06"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="07"){
	 	
	 		IF($KJJG_1=="07"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="08"){
	 	
	 		IF($KJJG_1=="08"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="09"){
	 	
	 		IF($KJJG_1=="09"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="10"){
	 	
	 		IF($KJJG_1=="10"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="11"){
	 	
	 		IF($KJJG_1=="11"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="12"){
	 	
	 		IF($KJJG_1=="12"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="13"){
	 	
	 		IF($KJJG_1=="13"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="14"){
	 	
	 		IF($KJJG_1=="14"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="15"){
	 	
	 		IF($KJJG_1=="15"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="16"){
	 	
	 		IF($KJJG_1=="16"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="17"){
	 	
	 		IF($KJJG_1=="17"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="18"){
	 	
	 		IF($KJJG_1=="18"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="19"){
	 	
	 		IF($KJJG_1=="19"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="20"){
	 	
	 		IF($KJJG_1=="20"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="21"){
	 	
	 		IF($KJJG_1=="21"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="22"){
	 	
	 		IF($KJJG_1=="22"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="23"){
	 	
	 		IF($KJJG_1=="23"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="24"){
	 	
	 		IF($KJJG_1=="24"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="25"){
	 	
	 		IF($KJJG_1=="25"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="26"){
	 	
	 		IF($KJJG_1=="26"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="27"){
	 	
	 		IF($KJJG_1=="27"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="28"){
	 	
	 		IF($KJJG_1=="28"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="29"){
	 	
	 		IF($KJJG_1=="29"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="30"){
	 	
	 		IF($KJJG_1=="30"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="31"){
	 	
	 		IF($KJJG_1=="31"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="32"){
	 	
	 		IF($KJJG_1=="32"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="33"){
	 	
	 		IF($KJJG_1=="33"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="34"){
	 	
	 		IF($KJJG_1=="34"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="35"){
	 	
	 		IF($KJJG_1=="35"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="36"){
	 	
	 		IF($KJJG_1=="36"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="37"){
	 	
	 		IF($KJJG_1=="37"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="38"){
	 	
	 		IF($KJJG_1=="38"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="39"){
	 	
	 		IF($KJJG_1=="39"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="40"){
	 	
	 		IF($KJJG_1=="40"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="41"){
	 	
	 		IF($KJJG_1=="41"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="42"){
	 	
	 		IF($KJJG_1=="42"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="43"){
	 	
	 		IF($KJJG_1=="43"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="44"){
	 	
	 		IF($KJJG_1=="44"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="45"){
	 	
	 		IF($KJJG_1=="45"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="46"){
	 	
	 		IF($KJJG_1=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="47"){
	 	
	 		IF($KJJG_1=="47"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="48"){
	 	
	 		IF($KJJG_1=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="49"){
	 	
	 		IF($KJJG_1=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 }
	 if($WFNAME['class_name_mini'] == "正二特"){
	 		
	 	IF($OLD_TZ['tzhm']=="01"){
	 	
	 		IF($KJJG_2=="01"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="02"){
	 	
	 		IF($KJJG_2=="02"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="03"){
	 	
	 		IF($KJJG_2=="03"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="04"){
	 	
	 		IF($KJJG_2=="04"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="05"){
	 	
	 		IF($KJJG_2=="05"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="06"){
	 	
	 		IF($KJJG_2=="06"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="07"){
	 	
	 		IF($KJJG_2=="07"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="08"){
	 	
	 		IF($KJJG_2=="08"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="09"){
	 	
	 		IF($KJJG_2=="09"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="10"){
	 	
	 		IF($KJJG_2=="10"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="11"){
	 	
	 		IF($KJJG_2=="11"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="12"){
	 	
	 		IF($KJJG_2=="12"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="13"){
	 	
	 		IF($KJJG_2=="13"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="14"){
	 	
	 		IF($KJJG_2=="14"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="15"){
	 	
	 		IF($KJJG_2=="15"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="16"){
	 	
	 		IF($KJJG_2=="16"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="17"){
	 	
	 		IF($KJJG_2=="17"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="18"){
	 	
	 		IF($KJJG_2=="18"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="19"){
	 	
	 		IF($KJJG_2=="19"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="20"){
	 	
	 		IF($KJJG_2=="20"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="21"){
	 	
	 		IF($KJJG_2=="21"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="22"){
	 	
	 		IF($KJJG_2=="22"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="23"){
	 	
	 		IF($KJJG_2=="23"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="24"){
	 	
	 		IF($KJJG_2=="24"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="25"){
	 	
	 		IF($KJJG_2=="25"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="26"){
	 	
	 		IF($KJJG_2=="26"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="27"){
	 	
	 		IF($KJJG_2=="27"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="28"){
	 	
	 		IF($KJJG_2=="28"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="29"){
	 	
	 		IF($KJJG_2=="29"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="30"){
	 	
	 		IF($KJJG_2=="30"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="31"){
	 	
	 		IF($KJJG_2=="31"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="32"){
	 	
	 		IF($KJJG_2=="32"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="33"){
	 	
	 		IF($KJJG_2=="33"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="34"){
	 	
	 		IF($KJJG_2=="34"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="35"){
	 	
	 		IF($KJJG_2=="35"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="36"){
	 	
	 		IF($KJJG_2=="36"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="37"){
	 	
	 		IF($KJJG_2=="37"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="38"){
	 	
	 		IF($KJJG_2=="38"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="39"){
	 	
	 		IF($KJJG_2=="39"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="40"){
	 	
	 		IF($KJJG_2=="40"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="41"){
	 	
	 		IF($KJJG_2=="41"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="42"){
	 	
	 		IF($KJJG_2=="42"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="43"){
	 	
	 		IF($KJJG_2=="43"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="44"){
	 	
	 		IF($KJJG_2=="44"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="45"){
	 	
	 		IF($KJJG_2=="45"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="46"){
	 	
	 		IF($KJJG_2=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="47"){
	 	
	 		IF($KJJG_2=="47"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="48"){
	 	
	 		IF($KJJG_2=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="49"){
	 	
	 		IF($KJJG_2=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	}
	
	if($WFNAME['class_name_mini'] == "正三特"){		
	 	IF($OLD_TZ['tzhm']=="01"){
	 	
	 		IF($KJJG_3=="01"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="02"){
	 	
	 		IF($KJJG_3=="02"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="03"){
	 	
	 		IF($KJJG_3=="03"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="04"){
	 	
	 		IF($KJJG_3=="04"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="05"){
	 	
	 		IF($KJJG_3=="05"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="06"){
	 	
	 		IF($KJJG_3=="06"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="07"){
	 	
	 		IF($KJJG_3=="07"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="08"){
	 	
	 		IF($KJJG_3=="08"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="09"){
	 	
	 		IF($KJJG_3=="09"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="10"){
	 	
	 		IF($KJJG_3=="10"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="11"){
	 	
	 		IF($KJJG_3=="11"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="12"){
	 	
	 		IF($KJJG_3=="12"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="13"){
	 	
	 		IF($KJJG_3=="13"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="14"){
	 	
	 		IF($KJJG_3=="14"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="15"){
	 	
	 		IF($KJJG_3=="15"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="16"){
	 	
	 		IF($KJJG_3=="16"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="17"){
	 	
	 		IF($KJJG_3=="17"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="18"){
	 	
	 		IF($KJJG_3=="18"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="19"){
	 	
	 		IF($KJJG_3=="19"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="20"){
	 	
	 		IF($KJJG_3=="20"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="21"){
	 	
	 		IF($KJJG_3=="21"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="22"){
	 	
	 		IF($KJJG_3=="22"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="23"){
	 	
	 		IF($KJJG_3=="23"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="24"){
	 	
	 		IF($KJJG_3=="24"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="25"){
	 	
	 		IF($KJJG_3=="25"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="26"){
	 	
	 		IF($KJJG_3=="26"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="27"){
	 	
	 		IF($KJJG_3=="27"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="28"){
	 	
	 		IF($KJJG_3=="28"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="29"){
	 	
	 		IF($KJJG_3=="29"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="30"){
	 	
	 		IF($KJJG_3=="30"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="31"){
	 	
	 		IF($KJJG_3=="31"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="32"){
	 	
	 		IF($KJJG_3=="32"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="33"){
	 	
	 		IF($KJJG_3=="33"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="34"){
	 	
	 		IF($KJJG_3=="34"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="35"){
	 	
	 		IF($KJJG_3=="35"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="36"){
	 	
	 		IF($KJJG_3=="36"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="37"){
	 	
	 		IF($KJJG_3=="37"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="38"){
	 	
	 		IF($KJJG_3=="38"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="39"){
	 	
	 		IF($KJJG_3=="39"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="40"){
	 	
	 		IF($KJJG_3=="40"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="41"){
	 	
	 		IF($KJJG_3=="41"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="42"){
	 	
	 		IF($KJJG_3=="42"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="43"){
	 	
	 		IF($KJJG_3=="43"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="44"){
	 	
	 		IF($KJJG_3=="44"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="45"){
	 	
	 		IF($KJJG_3=="45"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="46"){
	 	
	 		IF($KJJG_3=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="47"){
	 	
	 		IF($KJJG_3=="47"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="48"){
	 	
	 		IF($KJJG_3=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="49"){
	 	
	 		IF($KJJG_3=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	}
	if($WFNAME['class_name_mini'] == "正四特"){
	 	IF($OLD_TZ['tzhm']=="01"){
	 	
	 		IF($KJJG_4=="01"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="02"){
	 	
	 		IF($KJJG_4=="02"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="03"){
	 	
	 		IF($KJJG_4=="03"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="04"){
	 	
	 		IF($KJJG_4=="04"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="05"){
	 	
	 		IF($KJJG_4=="05"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="06"){
	 	
	 		IF($KJJG_4=="06"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="07"){
	 	
	 		IF($KJJG_4=="07"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="08"){
	 	
	 		IF($KJJG_4=="08"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="09"){
	 	
	 		IF($KJJG_4=="09"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="10"){
	 	
	 		IF($KJJG_4=="10"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="11"){
	 	
	 		IF($KJJG_4=="11"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="12"){
	 	
	 		IF($KJJG_4=="12"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="13"){
	 	
	 		IF($KJJG_4=="13"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="14"){
	 	
	 		IF($KJJG_4=="14"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="15"){
	 	
	 		IF($KJJG_4=="15"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="16"){
	 	
	 		IF($KJJG_4=="16"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="17"){
	 	
	 		IF($KJJG_4=="17"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="18"){
	 	
	 		IF($KJJG_4=="18"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="19"){
	 	
	 		IF($KJJG_4=="19"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="20"){
	 	
	 		IF($KJJG_4=="20"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="21"){
	 	
	 		IF($KJJG_4=="21"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="22"){
	 	
	 		IF($KJJG_4=="22"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="23"){
	 	
	 		IF($KJJG_4=="23"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="24"){
	 	
	 		IF($KJJG_4=="24"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="25"){
	 	
	 		IF($KJJG_4=="25"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="26"){
	 	
	 		IF($KJJG_4=="26"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="27"){
	 	
	 		IF($KJJG_4=="27"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="28"){
	 	
	 		IF($KJJG_4=="28"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="29"){
	 	
	 		IF($KJJG_4=="29"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="30"){
	 	
	 		IF($KJJG_4=="30"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="31"){
	 	
	 		IF($KJJG_4=="31"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="32"){
	 	
	 		IF($KJJG_4=="32"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="33"){
	 	
	 		IF($KJJG_4=="33"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="34"){
	 	
	 		IF($KJJG_4=="34"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="35"){
	 	
	 		IF($KJJG_4=="35"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="36"){
	 	
	 		IF($KJJG_4=="36"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="37"){
	 	
	 		IF($KJJG_4=="37"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="38"){
	 	
	 		IF($KJJG_4=="38"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="39"){
	 	
	 		IF($KJJG_4=="39"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="40"){
	 	
	 		IF($KJJG_4=="40"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="41"){
	 	
	 		IF($KJJG_4=="41"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="42"){
	 	
	 		IF($KJJG_4=="42"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="43"){
	 	
	 		IF($KJJG_4=="43"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="44"){
	 	
	 		IF($KJJG_4=="44"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="45"){
	 	
	 		IF($KJJG_4=="45"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="46"){
	 	
	 		IF($KJJG_4=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="47"){
	 	
	 		IF($KJJG_4=="47"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="48"){
	 	
	 		IF($KJJG_4=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="49"){
	 	
	 		IF($KJJG_4=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	}
	if($WFNAME['class_name_mini'] == "正五特"){
	 		
	 	IF($OLD_TZ['tzhm']=="01"){
	 	
	 		IF($KJJG_5=="01"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="02"){
	 	
	 		IF($KJJG_5=="02"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="03"){
	 	
	 		IF($KJJG_5=="03"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="04"){
	 	
	 		IF($KJJG_5=="04"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="05"){
	 	
	 		IF($KJJG_5=="05"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="06"){
	 	
	 		IF($KJJG_5=="06"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="07"){
	 	
	 		IF($KJJG_5=="07"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="08"){
	 	
	 		IF($KJJG_5=="08"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="09"){
	 	
	 		IF($KJJG_5=="09"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="10"){
	 	
	 		IF($KJJG_5=="10"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="11"){
	 	
	 		IF($KJJG_5=="11"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="12"){
	 	
	 		IF($KJJG_5=="12"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="13"){
	 	
	 		IF($KJJG_5=="13"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="14"){
	 	
	 		IF($KJJG_5=="14"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="15"){
	 	
	 		IF($KJJG_5=="15"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="16"){
	 	
	 		IF($KJJG_5=="16"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="17"){
	 	
	 		IF($KJJG_5=="17"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="18"){
	 	
	 		IF($KJJG_5=="18"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="19"){
	 	
	 		IF($KJJG_5=="19"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="20"){
	 	
	 		IF($KJJG_5=="20"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="21"){
	 	
	 		IF($KJJG_5=="21"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="22"){
	 	
	 		IF($KJJG_5=="22"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="23"){
	 	
	 		IF($KJJG_5=="23"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="24"){
	 	
	 		IF($KJJG_5=="24"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="25"){
	 	
	 		IF($KJJG_5=="25"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="26"){
	 	
	 		IF($KJJG_5=="26"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="27"){
	 	
	 		IF($KJJG_5=="27"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="28"){
	 	
	 		IF($KJJG_5=="28"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="29"){
	 	
	 		IF($KJJG_5=="29"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="30"){
	 	
	 		IF($KJJG_5=="30"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="31"){
	 	
	 		IF($KJJG_5=="31"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="32"){
	 	
	 		IF($KJJG_5=="32"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="33"){
	 	
	 		IF($KJJG_5=="33"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="34"){
	 	
	 		IF($KJJG_5=="34"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="35"){
	 	
	 		IF($KJJG_5=="35"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="36"){
	 	
	 		IF($KJJG_5=="36"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="37"){
	 	
	 		IF($KJJG_5=="37"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="38"){
	 	
	 		IF($KJJG_5=="38"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="39"){
	 	
	 		IF($KJJG_5=="39"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="40"){
	 	
	 		IF($KJJG_5=="40"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="41"){
	 	
	 		IF($KJJG_5=="41"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="42"){
	 	
	 		IF($KJJG_5=="42"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="43"){
	 	
	 		IF($KJJG_5=="43"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="44"){
	 	
	 		IF($KJJG_5=="44"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="45"){
	 	
	 		IF($KJJG_5=="45"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="46"){
	 	
	 		IF($KJJG_5=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="47"){
	 	
	 		IF($KJJG_5=="47"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="48"){
	 	
	 		IF($KJJG_5=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="49"){
	 	
	 		IF($KJJG_5=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	}
	if($WFNAME['class_name_mini'] == "正六特"){
	 	IF($OLD_TZ['tzhm']=="01"){
	 	
	 		IF($KJJG_6=="01"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="02"){
	 	
	 		IF($KJJG_6=="02"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="03"){
	 	
	 		IF($KJJG_6=="03"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="04"){
	 	
	 		IF($KJJG_6=="04"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="05"){
	 	
	 		IF($KJJG_6=="05"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="06"){
	 	
	 		IF($KJJG_6=="06"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="07"){
	 	
	 		IF($KJJG_6=="07"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="08"){
	 	
	 		IF($KJJG_6=="08"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="09"){
	 	
	 		IF($KJJG_6=="09"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 	IF($OLD_TZ['tzhm']=="10"){
	 	
	 		IF($KJJG_6=="10"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="11"){
	 	
	 		IF($KJJG_6=="11"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="12"){
	 	
	 		IF($KJJG_6=="12"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="13"){
	 	
	 		IF($KJJG_6=="13"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="14"){
	 	
	 		IF($KJJG_6=="14"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="15"){
	 	
	 		IF($KJJG_6=="15"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="16"){
	 	
	 		IF($KJJG_6=="16"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="17"){
	 	
	 		IF($KJJG_6=="17"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="18"){
	 	
	 		IF($KJJG_6=="18"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="19"){
	 	
	 		IF($KJJG_6=="19"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="20"){
	 	
	 		IF($KJJG_6=="20"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="21"){
	 	
	 		IF($KJJG_6=="21"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="22"){
	 	
	 		IF($KJJG_6=="22"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="23"){
	 	
	 		IF($KJJG_6=="23"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="24"){
	 	
	 		IF($KJJG_6=="24"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="25"){
	 	
	 		IF($KJJG_6=="25"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="26"){
	 	
	 		IF($KJJG_6=="26"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="27"){
	 	
	 		IF($KJJG_6=="27"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="28"){
	 	
	 		IF($KJJG_6=="28"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="29"){
	 	
	 		IF($KJJG_6=="29"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="30"){
	 	
	 		IF($KJJG_6=="30"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="31"){
	 	
	 		IF($KJJG_6=="31"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="32"){
	 	
	 		IF($KJJG_6=="32"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="33"){
	 	
	 		IF($KJJG_6=="33"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="34"){
	 	
	 		IF($KJJG_6=="34"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="35"){
	 	
	 		IF($KJJG_6=="35"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="36"){
	 	
	 		IF($KJJG_6=="36"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="37"){
	 	
	 		IF($KJJG_6=="37"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="38"){
	 	
	 		IF($KJJG_6=="38"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="39"){
	 	
	 		IF($KJJG_6=="39"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="40"){
	 	
	 		IF($KJJG_6=="40"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="41"){
	 	
	 		IF($KJJG_6=="41"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="42"){
	 	
	 		IF($KJJG_6=="42"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="43"){
	 	
	 		IF($KJJG_6=="43"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="44"){
	 	
	 		IF($KJJG_6=="44"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="45"){
	 	
	 		IF($KJJG_6=="45"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="46"){
	 	
	 		IF($KJJG_6=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="47"){
	 	
	 		IF($KJJG_6=="47"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="48"){
	 	
	 		IF($KJJG_6=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="49"){
	 	
	 		IF($KJJG_6=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 }
	 if($WFNAME['class_name_mini'] == "正码1-6"){
	 	IF($OLD_TZ['tzhm']=="正码一_单码"){
	 	
	 		IF($KJJG_1%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_双码"){
	 	
	 		IF($KJJG_1%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_大码"){
	 	
	 		IF($KJJG_1>24){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_小码"){
	 	
	 		IF($KJJG_1<25){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_合单"){
	 	
	 		IF((SUBSTR($KJJG_1,0,1)+SUBSTR($KJJG_1,1,1))%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_合双"){
	 	
	 		IF((SUBSTR($KJJG_1,0,1)+SUBSTR($KJJG_1,1,1))%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_合大"){
	 	
	 		IF((SUBSTR($KJJG_1,0,1)+SUBSTR($KJJG_1,1,1))>6){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_合小"){
	 	
	 		IF((SUBSTR($KJJG_1,0,1)+SUBSTR($KJJG_1,1,1))<7){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_红波"){
	 	
	 		IF($KJJG_1=="01"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="02"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="07"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="08"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="12"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="13"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="18"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="19"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="23"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="24"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="29"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="30"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="34"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="35"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="40"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="45"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_蓝波"){
	 	
	 		IF($KJJG_1=="03"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="04"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="09"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="10"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="14"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="15"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="20"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="25"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="26"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="31"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="36"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="37"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="41"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="42"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="47"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_绿波"){
	 	
	 		IF($KJJG_1=="05"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="06"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="11"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="16"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="17"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="21"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="22"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="27"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="28"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="32"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="33"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="38"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="39"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="43"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="44"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_1=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_尾大"){
	 	
	 		IF(SUBSTR($KJJG_1,1,1)>4){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码一_尾小"){
	 	
	 		IF(SUBSTR($KJJG_1,1,1)<5){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_单码"){
	 	
	 		IF($KJJG_2%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_双码"){
	 	
	 		IF($KJJG_2%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_大码"){
	 	
	 		IF($KJJG_2>24){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_小码"){
	 	
	 		IF($KJJG_2<25){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_合单"){
	 	
	 		IF((SUBSTR($KJJG_2,0,1)+SUBSTR($KJJG_2,1,1))%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_合双"){
	 	
	 		IF((SUBSTR($KJJG_2,0,1)+SUBSTR($KJJG_2,1,1))%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_合大"){
	 	
	 		IF((SUBSTR($KJJG_2,0,1)+SUBSTR($KJJG_2,1,1))>6){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_合小"){
	 	
	 		IF((SUBSTR($KJJG_2,0,1)+SUBSTR($KJJG_2,1,1))<7){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_红波"){
	 	
	 		IF($KJJG_2=="01"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="02"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="07"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="08"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="12"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="13"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="18"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="19"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="23"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="24"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="29"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="30"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="34"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="35"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="40"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="45"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_蓝波"){
	 	
	 		IF($KJJG_2=="03"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="04"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="09"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="10"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="14"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="15"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="20"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="25"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="26"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="31"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="36"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="37"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="41"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="42"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="47"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_绿波"){
	 	
	 		IF($KJJG_2=="05"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="06"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="11"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="16"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="17"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="21"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="22"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="27"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="28"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="32"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="33"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="38"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="39"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="43"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="44"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_2=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_尾大"){
	 	
	 		IF(SUBSTR($KJJG_2,1,1)>4){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码二_尾小"){
	 	
	 		IF(SUBSTR($KJJG_2,1,1)<5){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_单码"){
	 	
	 		IF($KJJG_3%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_双码"){
	 	
	 		IF($KJJG_3%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_大码"){
	 	
	 		IF($KJJG_3>24){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_小码"){
	 	
	 		IF($KJJG_3<25){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_合单"){
	 	
	 		IF((SUBSTR($KJJG_3,0,1)+SUBSTR($KJJG_3,1,1))%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_合双"){
	 	
	 		IF((SUBSTR($KJJG_3,0,1)+SUBSTR($KJJG_3,1,1))%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_合大"){
	 	
	 		IF((SUBSTR($KJJG_3,0,1)+SUBSTR($KJJG_3,1,1))>6){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_合小"){
	 	
	 		IF((SUBSTR($KJJG_3,0,1)+SUBSTR($KJJG_3,1,1))<7){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_红波"){
	 	
	 		IF($KJJG_3=="01"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="02"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="07"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="08"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="12"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="13"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="18"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="19"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="23"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="24"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="29"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="30"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="34"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="35"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="40"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="45"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_蓝波"){
	 	
	 		IF($KJJG_3=="03"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="04"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="09"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="10"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="14"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="15"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="20"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="25"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="26"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="31"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="36"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="37"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="41"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="42"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="47"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_绿波"){
	 	
	 		IF($KJJG_3=="05"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="06"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="11"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="16"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="17"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="21"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="22"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="27"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="28"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="32"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="33"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="38"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="39"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="43"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="44"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_3=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_尾大"){
	 	
	 		IF(SUBSTR($KJJG_3,1,1)>4){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码三_尾小"){
	 	
	 		IF(SUBSTR($KJJG_3,1,1)<5){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_单码"){
	 	
	 		IF($KJJG_4%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_双码"){
	 	
	 		IF($KJJG_4%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_大码"){
	 	
	 		IF($KJJG_4>24){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_小码"){
	 	
	 		IF($KJJG_4<25){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_合单"){
	 	
	 		IF((SUBSTR($KJJG_4,0,1)+SUBSTR($KJJG_4,1,1))%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_合双"){
	 	
	 		IF((SUBSTR($KJJG_4,0,1)+SUBSTR($KJJG_4,1,1))%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_合大"){
	 	
	 		IF((SUBSTR($KJJG_4,0,1)+SUBSTR($KJJG_4,1,1))>6){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_合小"){
	 	
	 		IF((SUBSTR($KJJG_4,0,1)+SUBSTR($KJJG_4,1,1))<7){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_红波"){
	 	
	 		IF($KJJG_4=="01"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="02"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="07"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="08"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="12"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="13"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="18"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="19"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="23"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="24"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="29"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="30"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="34"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="35"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="40"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="45"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_蓝波"){
	 	
	 		IF($KJJG_4=="03"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="04"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="09"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="10"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="14"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="15"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="20"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="25"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="26"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="31"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="36"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="37"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="41"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="42"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="47"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_绿波"){
	 	
	 		IF($KJJG_4=="05"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="06"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="11"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="16"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="17"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="21"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="22"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="27"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="28"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="32"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="33"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="38"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="39"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="43"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="44"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_4=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_尾大"){
	 	
	 		IF(SUBSTR($KJJG_4,1,1)>4){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码四_尾小"){
	 	
	 		IF(SUBSTR($KJJG_4,1,1)<5){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_单码"){
	 	
	 		IF($KJJG_5%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_双码"){
	 	
	 		IF($KJJG_5%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_大码"){
	 	
	 		IF($KJJG_5>24){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_小码"){
	 	
	 		IF($KJJG_5<25){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_合单"){
	 	
	 		IF((SUBSTR($KJJG_5,0,1)+SUBSTR($KJJG_5,1,1))%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_合双"){
	 	
	 		IF((SUBSTR($KJJG_5,0,1)+SUBSTR($KJJG_5,1,1))%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_合大"){
	 	
	 		IF((SUBSTR($KJJG_5,0,1)+SUBSTR($KJJG_5,1,1))>6){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_合小"){
	 	
	 		IF((SUBSTR($KJJG_5,0,1)+SUBSTR($KJJG_5,1,1))<7){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_红波"){
	 	
	 		IF($KJJG_5=="01"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="02"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="07"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="08"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="12"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="13"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="18"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="19"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="23"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="24"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="29"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="30"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="34"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="35"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="40"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="45"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_蓝波"){
	 	
	 		IF($KJJG_5=="03"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="04"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="09"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="10"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="14"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="15"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="20"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="25"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="26"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="31"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="36"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="37"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="41"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="42"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="47"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_绿波"){
	 	
	 		IF($KJJG_5=="05"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="06"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="11"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="16"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="17"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="21"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="22"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="27"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="28"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="32"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="33"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="38"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="39"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="43"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="44"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_5=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_尾大"){
	 	
	 		IF(SUBSTR($KJJG_5,1,1)>4){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码五_尾小"){
	 	
	 		IF(SUBSTR($KJJG_5,1,1)<5){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_单码"){
	 	
	 		IF($KJJG_6%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_双码"){
	 	
	 		IF($KJJG_6%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_大码"){
	 	
	 		IF($KJJG_6>24){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_小码"){
	 	
	 		IF($KJJG_6<25){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_合单"){
	 	
	 		IF((SUBSTR($KJJG_6,0,1)+SUBSTR($KJJG_6,1,1))%2!=0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_合双"){
	 	
	 		IF((SUBSTR($KJJG_6,0,1)+SUBSTR($KJJG_6,1,1))%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_合大"){
	 	
	 		IF((SUBSTR($KJJG_6,0,1)+SUBSTR($KJJG_6,1,1))>6){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_合小"){
	 	
	 		IF((SUBSTR($KJJG_6,0,1)+SUBSTR($KJJG_6,1,1))<7){$ZJZS=$ZJZS+1;}
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_红波"){
	 	
	 		IF($KJJG_6=="01"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="02"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="07"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="08"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="12"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="13"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="18"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="19"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="23"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="24"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="29"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="30"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="34"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="35"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="40"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="45"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="46"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_蓝波"){
	 	
	 		IF($KJJG_6=="03"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="04"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="09"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="10"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="14"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="15"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="20"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="25"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="26"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="31"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="36"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="37"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="41"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="42"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="47"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="48"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_绿波"){
	 	
	 		IF($KJJG_6=="05"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="06"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="11"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="16"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="17"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="21"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="22"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="27"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="28"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="32"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="33"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="38"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="39"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="43"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="44"){$ZJZS=$ZJZS+1;}
	 	
	 		IF($KJJG_6=="49"){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_尾大"){
	 	
	 		IF(SUBSTR($KJJG_6,1,1)>4){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="正码六_尾小"){
	 	
	 		IF(SUBSTR($KJJG_6,1,1)<5){$ZJZS=$ZJZS+1;}
	 	
	 	}
	 		
	 }
	 if($WFNAME['class_name_mini'] == "正码过关"){
	 	
	 	
	 }

	 IF($WFNAME['class_name_mini']=="三全中"){
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_6)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF($ZHONGQIUHM>2){$ZJZS=$ZJZS+($ZHONGQIUHM*($ZHONGQIUHM-1)*($ZHONGQIUHM-2))/6;}
		 
	 }
	 IF($WFNAME['wanfa']=="二全中"){
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_6)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
		 
		 IF($ZHONGQIUHM>=2){$ZJZS=$ZJZS+($ZHONGQIUHM*($ZHONGQIUHM-1))/2;}
		 
	 }
	 IF($WFNAME['class_name_mini']=="三中二"){
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_6)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_7)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF($ZHONGQIUHM>2){$ZJZS=$ZJZS+($ZHONGQIUHM*($ZHONGQIUHM-1)*($ZHONGQIUHM-2))/6;}ELSEIF($ZHONGQIUHM==2){$ZJZS=$ZJZS+1;}
	 		
	 	$PLHF=explode("|",$OLD_TZ['dqpl']);
	 		
	 	IF($ZHONGQIUHM==2){$OLD_TZ['dqpl']=$PLHF[0];}
	 	IF($ZHONGQIUHM>=3){$OLD_TZ['dqpl']=$PLHF[1];}
	 		
	 }
	 IF($WFNAME['class_name_mini']=="二中特"){
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_6)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_7)){$ZHONGQIUHM=$ZHONGQIUHM+1;$TEM_ZF=1;}
	 		
	 	IF($ZHONGQIUHM>=2){$ZJZS=$ZJZS+($ZHONGQIUHM*($ZHONGQIUHM-1))/2;}
	 		
	 	$PLHF=explode("/",$OLD_TZ['dqpl']);
	 		
	 	IF($TEM_ZF==1){$OLD_TZ['dqpl']=$PLHF[0];}ELSE{$OLD_TZ['dqpl']=$PLHF[1];}
	 		
	 		
	 }
	 IF($WFNAME['class_name_mini']=="特串"){
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_6)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_7)){$ZHONGQIUHM=$ZHONGQIUHM+1;$TEM_ZF=1;}
	 		
	 	IF($ZHONGQIUHM>=2 && $TEM_ZF==1){$ZJZS=$ZJZS+($ZHONGQIUHM*($ZHONGQIUHM-1))/2;}
	 		
	 }
	 IF($WFNAME['class_name_mini']=="四全中"){
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_6)){$ZHONGQIUHM=$ZHONGQIUHM+1;}
	 		
	 	IF($ZHONGQIUHM>3){$ZJZS=$ZJZS+($ZHONGQIUHM*($ZHONGQIUHM-1)*($ZHONGQIUHM-2)*($ZHONGQIUHM-3))/24;}
	 		
	 }
	 IF($WFNAME['class_name_mini']=="二连肖"){
	 		
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 		
	 	FOR($LX=0;$LX<COUNT($HMARAY);$LX++){
	 
	 		FOR($QXB=1;$QXB<=7;$QXB++){
	 				
	 			IF($QXB==1){$KJJG_QSB=$KJJG_1;}
	 				
	 			IF($QXB==2){$KJJG_QSB=$KJJG_2;}
	 				
	 			IF($QXB==3){$KJJG_QSB=$KJJG_3;}
	 				
	 			IF($QXB==4){$KJJG_QSB=$KJJG_4;}
	 				
	 			IF($QXB==5){$KJJG_QSB=$KJJG_5;}
	 				
	 			IF($QXB==6){$KJJG_QSB=$KJJG_6;}
	 				
	 			IF($QXB==7){$KJJG_QSB=$KJJG_7;}
	 				
	 			IF($KJJG_QSB=="10" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="22" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="34" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="46" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			//----
	 			IF($KJJG_QSB=="09" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="21" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="33" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="45" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			//----
	 			IF($KJJG_QSB=="08" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="20" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="32" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="44" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			//----
	 			IF($KJJG_QSB=="07" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="19" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="31" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="43" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			//----
	 			IF($KJJG_QSB=="06" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="18" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="30" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="42" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			//----
	 			IF($KJJG_QSB=="05" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="17" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="29" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="41" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			//----
	 			IF($KJJG_QSB=="04" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="16" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="28" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="40" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			//----
	 			IF($KJJG_QSB=="03" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="15" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="27" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="39" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			//----
	 			IF($KJJG_QSB=="02" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="14" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="26" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="38" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			//----
	 			IF($KJJG_QSB=="01" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="13" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="25" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="37" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="49" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			//----
	 			IF($KJJG_QSB=="12" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="24" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="36" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="48" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			//----
	 			IF($KJJG_QSB=="11" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="23" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="35" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="47" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			//----
	 				
	 		}
	 
	 	}
	 		
	 	$ZONGZHONGSYS=$ZONGXIAO_1+$ZONGXIAO_2+$ZONGXIAO_3+$ZONGXIAO_4+$ZONGXIAO_5+$ZONGXIAO_6+$ZONGXIAO_7+$ZONGXIAO_8+$ZONGXIAO_9+$ZONGXIAO_10+$ZONGXIAO_11+$ZONGXIAO_12;
	 		
	 	$ZJZS=$ZJZS+($ZONGZHONGSYS*($ZONGZHONGSYS-1))/2;
	 		
	 }
	 
	 IF($WFNAME['class_name_mini']=="三连肖"){
	 		
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 		
	 	FOR($LX=0;$LX<COUNT($HMARAY);$LX++){
	 
	 		FOR($QXB=1;$QXB<=7;$QXB++){
	 				
	 			IF($QXB==1){$KJJG_QSB=$KJJG_1;}
	 				
	 			IF($QXB==2){$KJJG_QSB=$KJJG_2;}
	 				
	 			IF($QXB==3){$KJJG_QSB=$KJJG_3;}
	 				
	 			IF($QXB==4){$KJJG_QSB=$KJJG_4;}
	 				
	 			IF($QXB==5){$KJJG_QSB=$KJJG_5;}
	 				
	 			IF($QXB==6){$KJJG_QSB=$KJJG_6;}
	 				
	 			IF($QXB==7){$KJJG_QSB=$KJJG_7;}
	 				
	 		IF($KJJG_QSB=="10" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="22" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="34" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="46" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			//----
	 			IF($KJJG_QSB=="09" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="21" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="33" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="45" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			//----
	 			IF($KJJG_QSB=="08" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="20" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="32" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="44" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			//----
	 			IF($KJJG_QSB=="07" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="19" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="31" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="43" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			//----
	 			IF($KJJG_QSB=="06" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="18" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="30" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="42" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			//----
	 			IF($KJJG_QSB=="05" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="17" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="29" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="41" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			//----
	 			IF($KJJG_QSB=="04" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="16" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="28" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="40" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			//----
	 			IF($KJJG_QSB=="03" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="15" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="27" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="39" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			//----
	 			IF($KJJG_QSB=="02" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="14" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="26" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="38" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			//----
	 			IF($KJJG_QSB=="01" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="13" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="25" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="37" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="49" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			//----
	 			IF($KJJG_QSB=="12" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="24" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="36" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="48" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			//----
	 			IF($KJJG_QSB=="11" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="23" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="35" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="47" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			//----
	 				
	 		}
	 
	 	}
	 		
	 	$ZONGZHONGSYS=$ZONGXIAO_1+$ZONGXIAO_2+$ZONGXIAO_3+$ZONGXIAO_4+$ZONGXIAO_5+$ZONGXIAO_6+$ZONGXIAO_7+$ZONGXIAO_8+$ZONGXIAO_9+$ZONGXIAO_10+$ZONGXIAO_11+$ZONGXIAO_12;
	 		
	 	$ZJZS=$ZJZS+($ZONGZHONGSYS*($ZONGZHONGSYS-1)*($ZONGZHONGSYS-2))/6;
	 		
	 		
	 }
	 
	 IF($WFNAME['class_name_mini']=="四连肖"){
	 		
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 		
	 	FOR($LX=0;$LX<COUNT($HMARAY);$LX++){
	 
	 		FOR($QXB=1;$QXB<=7;$QXB++){
	 				
	 			IF($QXB==1){$KJJG_QSB=$KJJG_1;}
	 				
	 			IF($QXB==2){$KJJG_QSB=$KJJG_2;}
	 				
	 			IF($QXB==3){$KJJG_QSB=$KJJG_3;}
	 				
	 			IF($QXB==4){$KJJG_QSB=$KJJG_4;}
	 				
	 			IF($QXB==5){$KJJG_QSB=$KJJG_5;}
	 				
	 			IF($QXB==6){$KJJG_QSB=$KJJG_6;}
	 				
	 			IF($QXB==7){$KJJG_QSB=$KJJG_7;}
	 				
	 		IF($KJJG_QSB=="10" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="22" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="34" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="46" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			//----
	 			IF($KJJG_QSB=="09" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="21" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="33" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="45" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			//----
	 			IF($KJJG_QSB=="08" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="20" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="32" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="44" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			//----
	 			IF($KJJG_QSB=="07" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="19" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="31" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="43" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			//----
	 			IF($KJJG_QSB=="06" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="18" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="30" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="42" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			//----
	 			IF($KJJG_QSB=="05" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="17" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="29" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="41" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			//----
	 			IF($KJJG_QSB=="04" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="16" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="28" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="40" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			//----
	 			IF($KJJG_QSB=="03" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="15" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="27" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="39" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			//----
	 			IF($KJJG_QSB=="02" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="14" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="26" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="38" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			//----
	 			IF($KJJG_QSB=="01" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="13" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="25" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="37" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="49" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			//----
	 			IF($KJJG_QSB=="12" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="24" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="36" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="48" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			//----
	 			IF($KJJG_QSB=="11" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="23" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="35" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="47" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			//----
	 				
	 		}
	 
	 	}
	 		
	 	$ZONGZHONGSYS=$ZONGXIAO_1+$ZONGXIAO_2+$ZONGXIAO_3+$ZONGXIAO_4+$ZONGXIAO_5+$ZONGXIAO_6+$ZONGXIAO_7+$ZONGXIAO_8+$ZONGXIAO_9+$ZONGXIAO_10+$ZONGXIAO_11+$ZONGXIAO_12;
	 		
	 	$ZJZS=$ZJZS+($ZONGZHONGSYS*($ZONGZHONGSYS-1)*($ZONGZHONGSYS-2)*($ZONGZHONGSYS-3))/24;
	 		
	 }
	 
	 IF($WFNAME['class_name_mini']=="五连肖"){
	 		
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 		
	 	FOR($LX=0;$LX<COUNT($HMARAY);$LX++){
	 
	 		FOR($QXB=1;$QXB<=7;$QXB++){
	 				
	 			IF($QXB==1){$KJJG_QSB=$KJJG_1;}
	 				
	 			IF($QXB==2){$KJJG_QSB=$KJJG_2;}
	 				
	 			IF($QXB==3){$KJJG_QSB=$KJJG_3;}
	 				
	 			IF($QXB==4){$KJJG_QSB=$KJJG_4;}
	 				
	 			IF($QXB==5){$KJJG_QSB=$KJJG_5;}
	 				
	 			IF($QXB==6){$KJJG_QSB=$KJJG_6;}
	 				
	 			IF($QXB==7){$KJJG_QSB=$KJJG_7;}
	 				
	 		IF($KJJG_QSB=="10" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="22" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="34" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="46" && $HMARAY[$LX]=="牛"){$ZONGXIAO_1=1;}
	 			//----
	 			IF($KJJG_QSB=="09" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="21" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="33" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="45" && $HMARAY[$LX]=="虎"){$ZONGXIAO_2=1;}
	 			//----
	 			IF($KJJG_QSB=="08" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="20" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="32" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="44" && $HMARAY[$LX]=="兔"){$ZONGXIAO_3=1;}
	 			//----
	 			IF($KJJG_QSB=="07" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="19" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="31" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="43" && $HMARAY[$LX]=="龙"){$ZONGXIAO_4=1;}
	 			//----
	 			IF($KJJG_QSB=="06" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="18" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="30" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="42" && $HMARAY[$LX]=="蛇"){$ZONGXIAO_5=1;}
	 			//----
	 			IF($KJJG_QSB=="05" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="17" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="29" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="41" && $HMARAY[$LX]=="马"){$ZONGXIAO_6=1;}
	 			//----
	 			IF($KJJG_QSB=="04" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="16" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="28" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="40" && $HMARAY[$LX]=="羊"){$ZONGXIAO_7=1;}
	 			//----
	 			IF($KJJG_QSB=="03" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="15" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="27" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="39" && $HMARAY[$LX]=="猴"){$ZONGXIAO_8=1;}
	 			//----
	 			IF($KJJG_QSB=="02" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="14" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="26" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="38" && $HMARAY[$LX]=="鸡"){$ZONGXIAO_9=1;}
	 			//----
	 			IF($KJJG_QSB=="01" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="13" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="25" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="37" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="49" && $HMARAY[$LX]=="狗"){$ZONGXIAO_10=1;}
	 			//----
	 			IF($KJJG_QSB=="12" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="24" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="36" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			IF($KJJG_QSB=="48" && $HMARAY[$LX]=="猪"){$ZONGXIAO_11=1;}
	 			//----
	 			IF($KJJG_QSB=="11" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="23" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="35" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			IF($KJJG_QSB=="47" && $HMARAY[$LX]=="鼠"){$ZONGXIAO_12=1;}
	 			//----
	 				
	 		}
	 
	 	}
	 		
	 	$ZONGZHONGSYS=$ZONGXIAO_1+$ZONGXIAO_2+$ZONGXIAO_3+$ZONGXIAO_4+$ZONGXIAO_5+$ZONGXIAO_6+$ZONGXIAO_7+$ZONGXIAO_8+$ZONGXIAO_9+$ZONGXIAO_10+$ZONGXIAO_11+$ZONGXIAO_12;
	 		
	 	$ZJZS=$ZJZS+($ZONGZHONGSYS*($ZONGZHONGSYS-1)*($ZONGZHONGSYS-2)*($ZONGZHONGSYS-3)*($ZONGZHONGSYS-4))/120;
	 		
	 }
	 IF($WFNAME['class_name_mini']=="二连尾"){
	 		
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 		
	 	FOR($LX=0;$LX<COUNT($HMARAY);$LX++){
	 
	 		FOR($QXB=1;$QXB<=7;$QXB++){
	 				
	 			IF($QXB==1){$KJJG_QSB=$KJJG_1;}
	 				
	 			IF($QXB==2){$KJJG_QSB=$KJJG_2;}
	 				
	 			IF($QXB==3){$KJJG_QSB=$KJJG_3;}
	 				
	 			IF($QXB==4){$KJJG_QSB=$KJJG_4;}
	 				
	 			IF($QXB==5){$KJJG_QSB=$KJJG_5;}
	 				
	 			IF($QXB==6){$KJJG_QSB=$KJJG_6;}
	 				
	 			IF($QXB==7){$KJJG_QSB=$KJJG_7;}
	 				
	 			IF($KJJG_QSB=="10" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="20" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="30" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="40" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 				
	 			IF($KJJG_QSB=="01" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="11" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="21" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="31" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="41" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 				
	 			IF($KJJG_QSB=="02" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="12" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="22" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="32" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="42" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 				
	 			IF($KJJG_QSB=="03" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="13" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="23" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="33" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="43" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 				
	 			IF($KJJG_QSB=="04" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="14" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="24" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="34" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="44" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 				
	 			IF($KJJG_QSB=="05" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="15" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="25" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="35" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="45" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 				
	 			IF($KJJG_QSB=="06" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="16" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="26" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="36" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="46" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 				
	 			IF($KJJG_QSB=="07" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="17" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="27" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="37" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="47" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 				
	 			IF($KJJG_QSB=="08" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="18" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="28" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="38" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="48" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 				
	 			IF($KJJG_QSB=="09" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="19" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="29" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="39" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="49" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 				
	 		}
	 
	 	}
	 		
	 	$ZONGZHONGSYS=$ZONGXIAO_1+$ZONGXIAO_2+$ZONGXIAO_3+$ZONGXIAO_4+$ZONGXIAO_5+$ZONGXIAO_6+$ZONGXIAO_7+$ZONGXIAO_8+$ZONGXIAO_9+$ZONGXIAO_10;
	 		
	 	$ZJZS=$ZJZS+($ZONGZHONGSYS*($ZONGZHONGSYS-1))/2;
	 		
	 }
	 IF($WFNAME['class_name_mini']=="三连尾"){
	 		
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 		
	 	FOR($LX=0;$LX<COUNT($HMARAY);$LX++){
	 
	 		FOR($QXB=1;$QXB<=7;$QXB++){
	 				
	 			IF($QXB==1){$KJJG_QSB=$KJJG_1;}
	 				
	 			IF($QXB==2){$KJJG_QSB=$KJJG_2;}
	 				
	 			IF($QXB==3){$KJJG_QSB=$KJJG_3;}
	 				
	 			IF($QXB==4){$KJJG_QSB=$KJJG_4;}
	 				
	 			IF($QXB==5){$KJJG_QSB=$KJJG_5;}
	 				
	 			IF($QXB==6){$KJJG_QSB=$KJJG_6;}
	 				
	 			IF($QXB==7){$KJJG_QSB=$KJJG_7;}
	 				
	 			IF($KJJG_QSB=="10" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="20" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="30" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="40" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 				
	 			IF($KJJG_QSB=="01" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="11" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="21" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="31" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="41" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 				
	 			IF($KJJG_QSB=="02" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="12" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="22" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="32" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="42" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 				
	 			IF($KJJG_QSB=="03" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="13" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="23" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="33" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="43" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 				
	 			IF($KJJG_QSB=="04" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="14" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="24" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="34" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="44" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 				
	 			IF($KJJG_QSB=="05" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="15" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="25" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="35" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="45" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 				
	 			IF($KJJG_QSB=="06" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="16" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="26" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="36" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="46" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 				
	 			IF($KJJG_QSB=="07" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="17" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="27" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="37" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="47" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 				
	 			IF($KJJG_QSB=="08" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="18" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="28" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="38" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="48" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 				
	 			IF($KJJG_QSB=="09" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="19" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="29" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="39" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="49" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 				
	 		}
	 
	 	}
	 		
	 	$ZONGZHONGSYS=$ZONGXIAO_1+$ZONGXIAO_2+$ZONGXIAO_3+$ZONGXIAO_4+$ZONGXIAO_5+$ZONGXIAO_6+$ZONGXIAO_7+$ZONGXIAO_8+$ZONGXIAO_9+$ZONGXIAO_10;
	 		
	 	$ZJZS=$ZJZS+($ZONGZHONGSYS*($ZONGZHONGSYS-1)*($ZONGZHONGSYS-2))/6;
	 		
	 }
	 IF($WFNAME['class_name_mini']=="四连尾"){
	 		
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 		
	 	FOR($LX=0;$LX<COUNT($HMARAY);$LX++){
	 
	 		FOR($QXB=1;$QXB<=7;$QXB++){
	 				
	 			IF($QXB==1){$KJJG_QSB=$KJJG_1;}
	 				
	 			IF($QXB==2){$KJJG_QSB=$KJJG_2;}
	 				
	 			IF($QXB==3){$KJJG_QSB=$KJJG_3;}
	 				
	 			IF($QXB==4){$KJJG_QSB=$KJJG_4;}
	 				
	 			IF($QXB==5){$KJJG_QSB=$KJJG_5;}
	 				
	 			IF($QXB==6){$KJJG_QSB=$KJJG_6;}
	 				
	 			IF($QXB==7){$KJJG_QSB=$KJJG_7;}
	 				
	 			IF($KJJG_QSB=="10" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="20" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="30" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="40" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 				
	 			IF($KJJG_QSB=="01" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="11" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="21" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="31" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="41" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 				
	 			IF($KJJG_QSB=="02" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="12" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="22" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="32" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="42" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 				
	 			IF($KJJG_QSB=="03" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="13" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="23" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="33" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="43" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 				
	 			IF($KJJG_QSB=="04" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="14" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="24" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="34" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="44" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 				
	 			IF($KJJG_QSB=="05" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="15" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="25" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="35" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="45" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 				
	 			IF($KJJG_QSB=="06" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="16" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="26" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="36" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="46" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 				
	 			IF($KJJG_QSB=="07" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="17" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="27" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="37" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="47" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 				
	 			IF($KJJG_QSB=="08" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="18" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="28" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="38" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="48" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 				
	 			IF($KJJG_QSB=="09" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="19" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="29" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="39" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="49" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 				
	 		}
	 
	 	}
	 		
	 	$ZONGZHONGSYS=$ZONGXIAO_1+$ZONGXIAO_2+$ZONGXIAO_3+$ZONGXIAO_4+$ZONGXIAO_5+$ZONGXIAO_6+$ZONGXIAO_7+$ZONGXIAO_8+$ZONGXIAO_9+$ZONGXIAO_10;
	 		
	 	$ZJZS=$ZJZS+($ZONGZHONGSYS*($ZONGZHONGSYS-1)*($ZONGZHONGSYS-2)*($ZONGZHONGSYS-3))/24;
	 		
	 }
	 IF($WFNAME['class_name_mini']=="五连尾"){
	 		
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 		
	 	FOR($LX=0;$LX<COUNT($HMARAY);$LX++){
	 
	 		FOR($QXB=1;$QXB<=7;$QXB++){
	 				
	 			IF($QXB==1){$KJJG_QSB=$KJJG_1;}
	 				
	 			IF($QXB==2){$KJJG_QSB=$KJJG_2;}
	 				
	 			IF($QXB==3){$KJJG_QSB=$KJJG_3;}
	 				
	 			IF($QXB==4){$KJJG_QSB=$KJJG_4;}
	 				
	 			IF($QXB==5){$KJJG_QSB=$KJJG_5;}
	 				
	 			IF($QXB==6){$KJJG_QSB=$KJJG_6;}
	 				
	 			IF($QXB==7){$KJJG_QSB=$KJJG_7;}
	 				
	 			IF($KJJG_QSB=="10" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="20" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="30" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 			IF($KJJG_QSB=="40" && $HMARAY[$LX]=="0尾"){$ZONGXIAO_1=1;}
	 				
	 			IF($KJJG_QSB=="01" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="11" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="21" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="31" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 			IF($KJJG_QSB=="41" && $HMARAY[$LX]=="1尾"){$ZONGXIAO_2=1;}
	 				
	 			IF($KJJG_QSB=="02" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="12" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="22" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="32" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 			IF($KJJG_QSB=="42" && $HMARAY[$LX]=="2尾"){$ZONGXIAO_3=1;}
	 				
	 			IF($KJJG_QSB=="03" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="13" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="23" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="33" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 			IF($KJJG_QSB=="43" && $HMARAY[$LX]=="3尾"){$ZONGXIAO_4=1;}
	 				
	 			IF($KJJG_QSB=="04" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="14" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="24" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="34" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 			IF($KJJG_QSB=="44" && $HMARAY[$LX]=="4尾"){$ZONGXIAO_5=1;}
	 				
	 			IF($KJJG_QSB=="05" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="15" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="25" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="35" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 			IF($KJJG_QSB=="45" && $HMARAY[$LX]=="5尾"){$ZONGXIAO_6=1;}
	 				
	 			IF($KJJG_QSB=="06" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="16" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="26" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="36" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 			IF($KJJG_QSB=="46" && $HMARAY[$LX]=="6尾"){$ZONGXIAO_7=1;}
	 				
	 			IF($KJJG_QSB=="07" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="17" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="27" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="37" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 			IF($KJJG_QSB=="47" && $HMARAY[$LX]=="7尾"){$ZONGXIAO_8=1;}
	 				
	 			IF($KJJG_QSB=="08" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="18" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="28" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="38" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 			IF($KJJG_QSB=="48" && $HMARAY[$LX]=="8尾"){$ZONGXIAO_9=1;}
	 				
	 			IF($KJJG_QSB=="09" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="19" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="29" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="39" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 			IF($KJJG_QSB=="49" && $HMARAY[$LX]=="9尾"){$ZONGXIAO_10=1;}
	 				
	 		}
	 
	 	}
	 		
	 	$ZONGZHONGSYS=$ZONGXIAO_1+$ZONGXIAO_2+$ZONGXIAO_3+$ZONGXIAO_4+$ZONGXIAO_5+$ZONGXIAO_6+$ZONGXIAO_7+$ZONGXIAO_8+$ZONGXIAO_9+$ZONGXIAO_10;
	 		
	 	$ZJZS=$ZJZS+($ZONGZHONGSYS*($ZONGZHONGSYS-1)*($ZONGZHONGSYS-2)*($ZONGZHONGSYS-3)*($ZONGZHONGSYS-4))/120;
	 		
	 }
	 
	 IF($WFNAME['class_name_mini']=="三色波"){
		 
		 IF($OLD_TZ['tzhm']=="红波"){
			 
			 IF($KJJG_7=="01"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="02"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="07"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="08"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="12"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="13"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="18"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="19"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="23"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="24"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="29"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="30"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="34"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="35"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="40"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="45"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="46"){$ZJZS=$ZJZS+1;}
		 
		 }

		 IF($OLD_TZ['tzhm']=="蓝波"){
			 
			 IF($KJJG_7=="03"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="04"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="09"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="10"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="14"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="15"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="20"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="25"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="26"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="31"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="36"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="37"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="41"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="42"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="47"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="48"){$ZJZS=$ZJZS+1;}
		 
		 }

		 IF($OLD_TZ['tzhm']=="绿波"){
			 
			 IF($KJJG_7=="05"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="06"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="11"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="16"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="17"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="21"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="22"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="27"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="28"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="32"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="33"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="38"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="39"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="43"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="44"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="49"){$ZJZS=$ZJZS+1;}
		 
		 }
		 
	 }
	 if($WFNAME['class_name_mini'] == "半波"){

		 IF($OLD_TZ['tzhm']=="红单"){
			 
			 IF($KJJG_7=="01"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="07"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="13"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="19"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="23"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="29"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="35"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="45"){$ZJZS=$ZJZS+1;}
		 
		 }
		 IF($OLD_TZ['tzhm']=="红双"){
			 
			 IF($KJJG_7=="02"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="08"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="12"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="18"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="24"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="30"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="34"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="40"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="46"){$ZJZS=$ZJZS+1;}
		 
		 }

		 IF($OLD_TZ['tzhm']=="红大"){
			 
			 IF($KJJG_7=="29"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="30"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="34"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="35"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="40"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="45"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="46"){$ZJZS=$ZJZS+1;}
		 
		 }
		 
		 IF($OLD_TZ['tzhm']=="红小"){
			 
			 IF($KJJG_7=="01"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="02"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="07"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="08"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="12"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="13"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="18"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="19"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="23"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="24"){$ZJZS=$ZJZS+1;}
		 
		 }
		 
		 IF($OLD_TZ['tzhm']=="蓝单"){
			 
			 IF($KJJG_7=="03"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="09"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="15"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="25"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="31"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="37"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="41"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="47"){$ZJZS=$ZJZS+1;}
			 
		 }
		 
		 IF($OLD_TZ['tzhm']=="蓝双"){
			 
			 IF($KJJG_7=="04"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="10"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="14"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="20"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="26"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="36"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="42"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="48"){$ZJZS=$ZJZS+1;}
			 
		 }
		 
		 IF($OLD_TZ['tzhm']=="蓝大"){
			 
			 IF($KJJG_7=="48"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="47"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="42"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="41"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="37"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="36"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="31"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="26"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="25"){$ZJZS=$ZJZS+1;}
			 
		 }
		 
		 IF($OLD_TZ['tzhm']=="蓝小"){
			 
			 IF($KJJG_7=="03"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="04"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="09"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="10"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="14"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="15"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="20"){$ZJZS=$ZJZS+1;}
			 
		 }
		 
		 IF($OLD_TZ['tzhm']=="绿单"){
			 
			 IF($KJJG_7=="05"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="11"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="17"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="21"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="27"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="33"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="39"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="43"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="49"){$ZJZS=$ZJZS+1;}
			 
		 }
		 
		 IF($OLD_TZ['tzhm']=="绿双"){
			 
			 IF($KJJG_7=="06"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="16"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="22"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="28"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="32"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="38"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="44"){$ZJZS=$ZJZS+1;}
			 
		 }
		 
		 IF($OLD_TZ['tzhm']=="绿大"){
			 
			 IF($KJJG_7=="27"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="28"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="32"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="33"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="38"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="39"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="43"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="44"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="49"){$ZJZS=$ZJZS+1;}
			 
		 }
		 
		 IF($OLD_TZ['tzhm']=="绿小"){
			 
			 IF($KJJG_7=="05"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="06"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="11"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="16"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="17"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="21"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="22"){$ZJZS=$ZJZS+1;}
			 
		 }
		 
	 }
	 if($WFNAME['class_name_mini']=="半半波"){

		 IF($OLD_TZ['tzhm']=="红大单"){
			 
			 IF($KJJG_7=="29"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="35"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="45"){$ZJZS=$ZJZS+1;}
			 
			 
		 }
		 
		 IF($OLD_TZ['tzhm']=="红大双"){
			 
			 IF($KJJG_7=="30"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="34"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="40"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="46"){$ZJZS=$ZJZS+1;}
		 }
		 
		 IF($OLD_TZ['tzhm']=="红小单"){
			 
			 IF($KJJG_7=="01"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="07"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="13"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="19"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="23"){$ZJZS=$ZJZS+1;}
		 }
		 
		 IF($OLD_TZ['tzhm']=="红小双"){
			 
			 IF($KJJG_7=="02"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="08"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="12"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="18"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="24"){$ZJZS=$ZJZS+1;}
		 }
		 
		 IF($OLD_TZ['tzhm']=="蓝大单"){
			 
			 IF($KJJG_7=="25"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="31"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="37"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="41"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="47"){$ZJZS=$ZJZS+1;}
		 }
		 
		 IF($OLD_TZ['tzhm']=="蓝大双"){
			 
			 IF($KJJG_7=="26"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="36"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="42"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="48"){$ZJZS=$ZJZS+1;}
		 }
		 
		 IF($OLD_TZ['tzhm']=="蓝小单"){
			 
			 IF($KJJG_7=="03"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="09"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="15"){$ZJZS=$ZJZS+1;}
		 }
		 
		 IF($OLD_TZ['tzhm']=="蓝小双"){
			 
			 IF($KJJG_7=="04"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="10"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="14"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="20"){$ZJZS=$ZJZS+1;}
		 }
		 
		 IF($OLD_TZ['tzhm']=="绿大单"){
			 
			 IF($KJJG_7=="27"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="33"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="39"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="43"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="49"){$ZJZS=$ZJZS+1;}
		 }
		 
		 IF($OLD_TZ['tzhm']=="绿大双"){
			 
			 IF($KJJG_7=="28"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="32"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="38"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="44"){$ZJZS=$ZJZS+1;}
		 }
		 
		 IF($OLD_TZ['tzhm']=="绿小单"){
			 
			 IF($KJJG_7=="05"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="11"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="17"){$ZJZS=$ZJZS+1;}
			 
			 IF($KJJG_7=="21"){$ZJZS=$ZJZS+1;}
		 }
		 
		 IF($OLD_TZ['tzhm']=="绿小双"){
			 
			 IF($KJJG_7=="06" || $KJJG_7=="16" || $KJJG_7=="22"){$ZJZS=$ZJZS+1;}
		 
		 }
		 
	 }
	 if($WFNAME['class_name_mini'] == "七色波"){
	 	
 		IF($OLD_TZ['tzhm']=="红波"){
 	
 			FOR($QXB=1;$QXB<=7;$QXB++){
 	
 				IF($QXB==1){$KJJG_QSB=$KJJG_1;}
 	
 				IF($QXB==2){$KJJG_QSB=$KJJG_2;}
 	
 				IF($QXB==3){$KJJG_QSB=$KJJG_3;}
 	
 				IF($QXB==4){$KJJG_QSB=$KJJG_4;}
 	
 				IF($QXB==5){$KJJG_QSB=$KJJG_5;}
 	
 				IF($QXB==6){$KJJG_QSB=$KJJG_6;}
 	
 				IF($QXB==7){$KJJG_QSB=$KJJG_7;}
 	
 				IF($KJJG_QSB=="01"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="02"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="07"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="08"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="12"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="13"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="18"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="19"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="23"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="24"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="29"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="30"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="34"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="35"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="40"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="45"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="46"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="03"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="04"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="09"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="10"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="14"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="15"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="20"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="25"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="26"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="31"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="36"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="37"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="41"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="42"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="47"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="48"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="05"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="06"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="11"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="16"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="17"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="21"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="22"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="27"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="28"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="32"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="33"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="38"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="39"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="43"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="44"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="49"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 			}
 	
 			IF($QISEBO_HONGBO>$QISEBO_LANBO && $QISEBO_HONGBO>$QISEBO_LVBO){$ZJZS=$ZJZS+1;}
 	
 		}
 	
 		IF($OLD_TZ['tzhm']=="蓝波"){
 	
 			FOR($QXB=1;$QXB<=7;$QXB++){
 	
 				IF($QXB==1){$KJJG_QSB=$KJJG_1;}
 	
 				IF($QXB==2){$KJJG_QSB=$KJJG_2;}
 	
 				IF($QXB==3){$KJJG_QSB=$KJJG_3;}
 	
 				IF($QXB==4){$KJJG_QSB=$KJJG_4;}
 	
 				IF($QXB==5){$KJJG_QSB=$KJJG_5;}
 	
 				IF($QXB==6){$KJJG_QSB=$KJJG_6;}
 	
 				IF($QXB==7){$KJJG_QSB=$KJJG_7;}
 	
 				IF($KJJG_QSB=="01"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="02"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="07"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="08"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="12"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="13"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="18"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="19"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="23"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="24"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="29"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="30"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="34"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="35"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="40"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="45"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="46"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="03"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="04"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="09"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="10"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="14"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="15"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="20"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="25"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="26"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="31"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="36"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="37"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="41"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="42"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="47"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="48"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="05"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="06"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="11"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="16"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="17"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="21"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="22"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="27"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="28"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="32"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="33"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="38"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="39"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="43"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="44"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="49"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 			}
 	
 			IF($QISEBO_LANBO>$QISEBO_HONGBO && $QISEBO_LANBO>$QISEBO_LVBO){$ZJZS=$ZJZS+1;}
 	
 		}
 	
 		IF($OLD_TZ['tzhm']=="绿波"){
 	
 			FOR($QXB=1;$QXB<=7;$QXB++){
 	
 				IF($QXB==1){$KJJG_QSB=$KJJG_1;}
 	
 				IF($QXB==2){$KJJG_QSB=$KJJG_2;}
 	
 				IF($QXB==3){$KJJG_QSB=$KJJG_3;}
 	
 				IF($QXB==4){$KJJG_QSB=$KJJG_4;}
 	
 				IF($QXB==5){$KJJG_QSB=$KJJG_5;}
 	
 				IF($QXB==6){$KJJG_QSB=$KJJG_6;}
 	
 				IF($QXB==7){$KJJG_QSB=$KJJG_7;}
 	
 				IF($KJJG_QSB=="01"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="02"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="07"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="08"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="12"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="13"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="18"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="19"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="23"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="24"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="29"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="30"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="34"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="35"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="40"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="45"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="46"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="03"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="04"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="09"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="10"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="14"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="15"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="20"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="25"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="26"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="31"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="36"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="37"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="41"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="42"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="47"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="48"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="05"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="06"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="11"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="16"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="17"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="21"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="22"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="27"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="28"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="32"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="33"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="38"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="39"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="43"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="44"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="49"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 			}
 	
 			IF($QISEBO_LVBO>$QISEBO_HONGBO && $QISEBO_LVBO>$QISEBO_LANBO){$ZJZS=$ZJZS+1;}
 	
 		}
 	
 		IF($OLD_TZ['tzhm']=="和局"){
 	
 			FOR($QXB=1;$QXB<=7;$QXB++){
 	
 				IF($QXB==1){$KJJG_QSB=$KJJG_1;}
 	
 				IF($QXB==2){$KJJG_QSB=$KJJG_2;}
 	
 				IF($QXB==3){$KJJG_QSB=$KJJG_3;}
 	
 				IF($QXB==4){$KJJG_QSB=$KJJG_4;}
 	
 				IF($QXB==5){$KJJG_QSB=$KJJG_5;}
 	
 				IF($QXB==6){$KJJG_QSB=$KJJG_6;}
 	
 				IF($QXB==7){$KJJG_QSB=$KJJG_7;}
 	
 				IF($KJJG_QSB=="01"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="02"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="07"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="08"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="12"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="13"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="18"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="19"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="23"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="24"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="29"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="30"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="34"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="35"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="40"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="45"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="46"){$QISEBO_HONGBO=$QISEBO_HONGBO+1;}
 	
 				IF($KJJG_QSB=="03"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="04"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="09"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="10"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="14"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="15"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="20"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="25"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="26"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="31"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="36"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="37"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="41"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="42"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="47"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="48"){$QISEBO_LANBO=$QISEBO_LANBO+1;}
 	
 				IF($KJJG_QSB=="05"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="06"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="11"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="16"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="17"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="21"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="22"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="27"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="28"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="32"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="33"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="38"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="39"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="43"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="44"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 				IF($KJJG_QSB=="49"){$QISEBO_LVBO=$QISEBO_LVBO+1;}
 	
 			}
 	
 			$HEZHJU=0;
 	
 			IF($QISEBO_LVBO==$QISEBO_HONGBO && $QISEBO_LVBO>$QISEBO_LANBO){$HEZHJU=1;}
 	
 			IF($QISEBO_LVBO==$QISEBO_LANBO && $QISEBO_LVBO>$QISEBO_HONGBO){$HEZHJU=1;}
 	
 			IF($QISEBO_HONGBO==$QISEBO_LANBO && $QISEBO_HONGBO>$QISEBO_LVBO){$HEZHJU=1;}
 	
 			IF($HEZHJU==1){$ZJZS=$ZJZS+1;}
 	
 		}

	 }
	 if($WFNAME['class_name_mini'] == "头尾数"){

	 		IF($OLD_TZ['tzhm']=="0头"){
	 	
	 			IF($KJJG_7=="01"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="02"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="03"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="04"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="05"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="06"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="07"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="08"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="09"){$ZJZS=$ZJZS+1;}
	 	
	 		}
	
	 		IF($OLD_TZ['tzhm']=="1头"){
	 	
	 			IF($KJJG_7=="10"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="11"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="12"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="13"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="14"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="15"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="16"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="17"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="18"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="19"){$ZJZS=$ZJZS+1;}
	 	
	 		}
		
	 		IF($OLD_TZ['tzhm']=="2头"){
	 	
	 			IF($KJJG_7=="20"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="21"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="22"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="23"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="24"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="25"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="26"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="27"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="28"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="29"){$ZJZS=$ZJZS+1;}
	 	
	 		}
		
	 		IF($OLD_TZ['tzhm']=="3头"){
	 	
	 			IF($KJJG_7=="30"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="31"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="32"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="33"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="34"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="35"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="36"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="37"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="38"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="39"){$ZJZS=$ZJZS+1;}
	 	
	 		}
		
	 		IF($OLD_TZ['tzhm']=="4头"){
	 	
	 			IF($KJJG_7=="40"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="41"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="42"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="43"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="44"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="45"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="46"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="47"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="48"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="49"){$ZJZS=$ZJZS+1;}
	 	
	 		}
		
	 		IF($OLD_TZ['tzhm']=="0尾"){
	 	
	 			IF($KJJG_7=="10"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="20"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="30"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="40"){$ZJZS=$ZJZS+1;}
	 	
	 		}
			
	 		IF($OLD_TZ['tzhm']=="1尾"){
	 	
	 			IF($KJJG_7=="01"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="11"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="21"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="31"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="41"){$ZJZS=$ZJZS+1;}
	 	
	 		}
	
	 		IF($OLD_TZ['tzhm']=="2尾"){
	 	
	 			IF($KJJG_7=="02"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="12"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="22"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="32"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="42"){$ZJZS=$ZJZS+1;}
	 	
	 		}
		
	 		IF($OLD_TZ['tzhm']=="3尾"){
	 	
	 			IF($KJJG_7=="03"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="13"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="23"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="33"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="43"){$ZJZS=$ZJZS+1;}
	 	
	 		}
 			
	 		IF($OLD_TZ['tzhm']=="4尾"){
	 	
	 			IF($KJJG_7=="04"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="14"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="24"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="34"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="44"){$ZJZS=$ZJZS+1;}
	 	
	 		}
 			
	 		IF($OLD_TZ['tzhm']=="5尾"){
	 	
	 			IF($KJJG_7=="05"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="15"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="25"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="35"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="45"){$ZJZS=$ZJZS+1;}
	 	
	 		}
 			
	 		IF($OLD_TZ['tzhm']=="6尾"){
	 	
	 			IF($KJJG_7=="06"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="16"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="26"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="36"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="46"){$ZJZS=$ZJZS+1;}
	 	
	 		}
			
	 		IF($OLD_TZ['tzhm']=="7尾"){
	 	
	 			IF($KJJG_7=="07"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="17"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="27"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="37"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="47"){$ZJZS=$ZJZS+1;}
	 	
	 		}
	
	 		IF($OLD_TZ['tzhm']=="8尾"){
	 	
	 			IF($KJJG_7=="08"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="18"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="28"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="38"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="48"){$ZJZS=$ZJZS+1;}
	 	
	 		}

	 		IF($OLD_TZ['tzhm']=="9尾"){
	 	
	 			IF($KJJG_7=="09"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="19"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="29"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="39"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="49"){$ZJZS=$ZJZS+1;}
	 	
	 		}
	
	 }
	 if($WFNAME['class_name_mini'] == "正特尾数"){

	 		IF($OLD_TZ['tzhm']=="0尾"){
	 			IF(SUBSTR($KJJG_1, STRLEN($KJJG_1)-1,1)==0 || SUBSTR($KJJG_2, STRLEN($KJJG_2)-1,1)==0 || SUBSTR($KJJG_3, STRLEN($KJJG_3)-1,1)==0 || SUBSTR($KJJG_4, STRLEN($KJJG_4)-1,1)==0 || SUBSTR($KJJG_5, STRLEN($KJJG_5)-1,1)==0 || SUBSTR($KJJG_6, STRLEN($KJJG_6)-1,1)==0){
	 				$ZJZS = $ZJZS+1;
	 			}
	 		}

	 		IF($OLD_TZ['tzhm']=="1尾"){
	 			IF(SUBSTR($KJJG_1, STRLEN($KJJG_1)-1,1)==1 || SUBSTR($KJJG_2, STRLEN($KJJG_2)-1,1)==1 || SUBSTR($KJJG_3, STRLEN($KJJG_3)-1,1)==1 || SUBSTR($KJJG_4, STRLEN($KJJG_4)-1,1)==1 || SUBSTR($KJJG_5, STRLEN($KJJG_5)-1,1)==1 || SUBSTR($KJJG_6, STRLEN($KJJG_6)-1,1)==1){
	 				$ZJZS = $ZJZS+1;
	 			}
	 		}

	 		IF($OLD_TZ['tzhm']=="2尾"){
	 			IF(SUBSTR($KJJG_1, STRLEN($KJJG_1)-1,1)==2 || SUBSTR($KJJG_2, STRLEN($KJJG_2)-1,1)==2 || SUBSTR($KJJG_3, STRLEN($KJJG_3)-1,1)==2 || SUBSTR($KJJG_4, STRLEN($KJJG_4)-1,1)==2 || SUBSTR($KJJG_5, STRLEN($KJJG_5)-1,1)==2 || SUBSTR($KJJG_6, STRLEN($KJJG_6)-1,1)==2){
	 				$ZJZS = $ZJZS+1;
	 			}
	 		}

	 		IF($OLD_TZ['tzhm']=="3尾"){
	 			IF(SUBSTR($KJJG_1, STRLEN($KJJG_1)-1,1)==3 || SUBSTR($KJJG_2, STRLEN($KJJG_2)-1,1)==3 || SUBSTR($KJJG_3, STRLEN($KJJG_3)-1,1)==3 || SUBSTR($KJJG_4, STRLEN($KJJG_4)-1,1)==3 || SUBSTR($KJJG_5, STRLEN($KJJG_5)-1,1)==3 || SUBSTR($KJJG_6, STRLEN($KJJG_6)-1,1)==3){
	 				$ZJZS = $ZJZS+1;
	 			}
	 		}

	 		IF($OLD_TZ['tzhm']=="4尾"){
	 			IF(SUBSTR($KJJG_1, STRLEN($KJJG_1)-1,1)==4 || SUBSTR($KJJG_2, STRLEN($KJJG_2)-1,1)==4 || SUBSTR($KJJG_3, STRLEN($KJJG_3)-1,1)==4 || SUBSTR($KJJG_4, STRLEN($KJJG_4)-1,1)==4 || SUBSTR($KJJG_5, STRLEN($KJJG_5)-1,1)==4 || SUBSTR($KJJG_6, STRLEN($KJJG_6)-1,1)==4){
	 				$ZJZS = $ZJZS+1;
	 			}
	 		}

	 		IF($OLD_TZ['tzhm']=="5尾"){
	 			IF(SUBSTR($KJJG_1, STRLEN($KJJG_1)-1,1)==5 || SUBSTR($KJJG_2, STRLEN($KJJG_2)-1,1)==5 || SUBSTR($KJJG_3, STRLEN($KJJG_3)-1,1)==5 || SUBSTR($KJJG_4, STRLEN($KJJG_4)-1,1)==5 || SUBSTR($KJJG_5, STRLEN($KJJG_5)-1,1)==5 || SUBSTR($KJJG_6, STRLEN($KJJG_6)-1,1)==5){
	 				$ZJZS = $ZJZS+1;
	 			}
	 		}

	 		IF($OLD_TZ['tzhm']=="6尾"){
	 			IF(SUBSTR($KJJG_1, STRLEN($KJJG_1)-1,1)==6 || SUBSTR($KJJG_2, STRLEN($KJJG_2)-1,1)==6 || SUBSTR($KJJG_3, STRLEN($KJJG_3)-1,1)==6 || SUBSTR($KJJG_4, STRLEN($KJJG_4)-1,1)==6 || SUBSTR($KJJG_5, STRLEN($KJJG_5)-1,1)==6 || SUBSTR($KJJG_6, STRLEN($KJJG_6)-1,1)==6){
	 				$ZJZS = $ZJZS+1;
	 			}
	 		}

	 		IF($OLD_TZ['tzhm']=="7尾"){
	 			IF(SUBSTR($KJJG_1, STRLEN($KJJG_1)-1,1)==7 || SUBSTR($KJJG_2, STRLEN($KJJG_2)-1,1)==7 || SUBSTR($KJJG_3, STRLEN($KJJG_3)-1,1)==7 || SUBSTR($KJJG_4, STRLEN($KJJG_4)-1,1)==7 || SUBSTR($KJJG_5, STRLEN($KJJG_5)-1,1)==7 || SUBSTR($KJJG_6, STRLEN($KJJG_6)-1,1)==7){
	 				$ZJZS = $ZJZS+1;
	 			}
	 		}
	
	 		IF($OLD_TZ['tzhm']=="8尾"){
	 			IF(SUBSTR($KJJG_1, STRLEN($KJJG_1)-1,1)==8 || SUBSTR($KJJG_2, STRLEN($KJJG_2)-1,1)==8 || SUBSTR($KJJG_3, STRLEN($KJJG_3)-1,1)==8 || SUBSTR($KJJG_4, STRLEN($KJJG_4)-1,1)==8 || SUBSTR($KJJG_5, STRLEN($KJJG_5)-1,1)==8 || SUBSTR($KJJG_6, STRLEN($KJJG_6)-1,1)==8){
	 				$ZJZS = $ZJZS+1;
	 			}
	 		}

	 		IF($OLD_TZ['tzhm']=="9尾"){
	 			IF(SUBSTR($KJJG_1, STRLEN($KJJG_1)-1,1)==9 || SUBSTR($KJJG_2, STRLEN($KJJG_2)-1,1)==9 || SUBSTR($KJJG_3, STRLEN($KJJG_3)-1,1)==9 || SUBSTR($KJJG_4, STRLEN($KJJG_4)-1,1)==9 || SUBSTR($KJJG_5, STRLEN($KJJG_5)-1,1)==9 || SUBSTR($KJJG_6, STRLEN($KJJG_6)-1,1)==9){
	 				$ZJZS = $ZJZS+1;
	 			}
	 		}
	 }
	 if($WFNAME['class_name_mini'] == "七码"){
	 	if($OLD_TZ['tzhm'] == "单0.双7"){
	 		if($KJJG_1%2==0 && $KJJG_2%2==0 && $KJJG_3%2==0 && $KJJG_4%2==0 && $KJJG_5%2==0 && $KJJG_6%2==0 && $KJJG_7%2==0){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "单1.双6"){
	 		$CXCS = 0;
	 		if($KJJG_1%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_2%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_3%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_4%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_5%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_6%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_7%2==1){$CXCS = $CXCS+1;}
	 		if($CXCS==1){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "单2.双5"){
	 		$CXCS = 0;
	 		if($KJJG_1%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_2%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_3%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_4%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_5%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_6%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_7%2==1){$CXCS = $CXCS+1;}
	 		if($CXCS==2){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "单3.双4"){
	 		$CXCS = 0;
	 		if($KJJG_1%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_2%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_3%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_4%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_5%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_6%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_7%2==1){$CXCS = $CXCS+1;}
	 		if($CXCS==3){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "单4.双3"){
	 		$CXCS = 0;
	 		if($KJJG_1%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_2%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_3%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_4%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_5%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_6%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_7%2==1){$CXCS = $CXCS+1;}
	 		if($CXCS==4){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "单5.双2"){
	 		$CXCS = 0;
	 		if($KJJG_1%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_2%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_3%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_4%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_5%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_6%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_7%2==1){$CXCS = $CXCS+1;}
	 		if($CXCS==5){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "单6.双1"){
	 		$CXCS = 0;
	 		if($KJJG_1%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_2%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_3%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_4%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_5%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_6%2==1){$CXCS = $CXCS+1;}
	 		if($KJJG_7%2==1){$CXCS = $CXCS+1;}
	 		if($CXCS==6){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "单7.双0"){
	 		if($KJJG_1%2==1 && $KJJG_2%2==1 && $KJJG_3%2==1 && $KJJG_4%2==1 && $KJJG_5%2==1 && $KJJG_6%2==1 && $KJJG_7%2==1){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if ($OLD_TZ['tzhm'] == "大0.小7") {
	 		if($KJJG_1>24 && $KJJG_2>24 && $KJJG_3>24 && $KJJG_4>24 && $KJJG_5>24 && $KJJG_6>24 && $KJJG_7>24){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "大1.小6"){
	 		$CXCS = 0;
	 		if($KJJG_1>24){$CXCS = $CXCS+1;}
	 		if($KJJG_2>24){$CXCS = $CXCS+1;}
	 		if($KJJG_3>24){$CXCS = $CXCS+1;}
	 		if($KJJG_4>24){$CXCS = $CXCS+1;}
	 		if($KJJG_5>24){$CXCS = $CXCS+1;}
	 		if($KJJG_6>24){$CXCS = $CXCS+1;}
	 		if($KJJG_7>24){$CXCS = $CXCS+1;}
	 		if($CXCS==1){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "大2.小5"){
	 		$CXCS = 0;
	 		if($KJJG_1>24){$CXCS = $CXCS+1;}
	 		if($KJJG_2>24){$CXCS = $CXCS+1;}
	 		if($KJJG_3>24){$CXCS = $CXCS+1;}
	 		if($KJJG_4>24){$CXCS = $CXCS+1;}
	 		if($KJJG_5>24){$CXCS = $CXCS+1;}
	 		if($KJJG_6>24){$CXCS = $CXCS+1;}
	 		if($KJJG_7>24){$CXCS = $CXCS+1;}
	 		if($CXCS==2){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "大3.小4"){
	 		$CXCS = 0;
	 		if($KJJG_1>24){$CXCS = $CXCS+1;}
	 		if($KJJG_2>24){$CXCS = $CXCS+1;}
	 		if($KJJG_3>24){$CXCS = $CXCS+1;}
	 		if($KJJG_4>24){$CXCS = $CXCS+1;}
	 		if($KJJG_5>24){$CXCS = $CXCS+1;}
	 		if($KJJG_6>24){$CXCS = $CXCS+1;}
	 		if($KJJG_7>24){$CXCS = $CXCS+1;}
	 		if($CXCS==3){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "大4.小3"){
	 		$CXCS = 0;
	 		if($KJJG_1>24){$CXCS = $CXCS+1;}
	 		if($KJJG_2>24){$CXCS = $CXCS+1;}
	 		if($KJJG_3>24){$CXCS = $CXCS+1;}
	 		if($KJJG_4>24){$CXCS = $CXCS+1;}
	 		if($KJJG_5>24){$CXCS = $CXCS+1;}
	 		if($KJJG_6>24){$CXCS = $CXCS+1;}
	 		if($KJJG_7>24){$CXCS = $CXCS+1;}
	 		if($CXCS==4){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "大5.小2"){
	 		$CXCS = 0;
	 		if($KJJG_1>24){$CXCS = $CXCS+1;}
	 		if($KJJG_2>24){$CXCS = $CXCS+1;}
	 		if($KJJG_3>24){$CXCS = $CXCS+1;}
	 		if($KJJG_4>24){$CXCS = $CXCS+1;}
	 		if($KJJG_5>24){$CXCS = $CXCS+1;}
	 		if($KJJG_6>24){$CXCS = $CXCS+1;}
	 		if($KJJG_7>24){$CXCS = $CXCS+1;}
	 		if($CXCS==5){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm'] == "大6.小1"){
	 		$CXCS = 0;
	 		if($KJJG_1>24){$CXCS = $CXCS+1;}
	 		if($KJJG_2>24){$CXCS = $CXCS+1;}
	 		if($KJJG_3>24){$CXCS = $CXCS+1;}
	 		if($KJJG_4>24){$CXCS = $CXCS+1;}
	 		if($KJJG_5>24){$CXCS = $CXCS+1;}
	 		if($KJJG_6>24){$CXCS = $CXCS+1;}
	 		if($KJJG_7>24){$CXCS = $CXCS+1;}
	 		if($CXCS==6){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 	if ($OLD_TZ['tzhm'] == "大7.小0") {
	 		if($KJJG_1<25 && $KJJG_2<25 && $KJJG_3<25 && $KJJG_4<25 && $KJJG_5<25 && $KJJG_6<25 && $KJJG_7<25){
	 			$ZJZS = $ZJZS+1;
	 		}
	 	}
	 }
	 if ($WFNAME['class_name_mini'] == "五行") {
	
	 		IF($OLD_TZ['tzhm']=="金"){
	 	
	 			IF($KJJG_7=="03"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="04"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="17"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="18"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="25"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="26"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="33"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="34"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="47"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="48"){$ZJZS=$ZJZS+1;}
	 		}
	
	 		IF($OLD_TZ['tzhm']=="木"){
	 	
	 			IF($KJJG_7=="07"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="08"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="15"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="16"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="29"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="30"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="37"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="38"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="45"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="46"){$ZJZS=$ZJZS+1;}
	 		}
	
	 		IF($OLD_TZ['tzhm']=="水"){
	 	
	 			IF($KJJG_7=="05"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="06"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="13"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="14"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="21"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="22"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="35"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="36"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="43"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="44"){$ZJZS=$ZJZS+1;}
	 		}
	
	 		IF($OLD_TZ['tzhm']=="火"){
	 	
	 			IF($KJJG_7=="01"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="02"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="09"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="10"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="23"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="24"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="31"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="32"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="39"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="40"){$ZJZS=$ZJZS+1;}
	 		}
	 		IF($OLD_TZ['tzhm']=="土"){
	 	
	 			IF($KJJG_7=="11"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="12"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="19"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="20"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="27"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="28"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="41"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="42"){$ZJZS=$ZJZS+1;}
	 	
	 			IF($KJJG_7=="49"){$ZJZS=$ZJZS+1;}
	 		}

	 }
	 if($WFNAME['class_name_mini'] == "五中一" || $WFNAME['class_name_mini'] == "六中一" || $WFNAME['class_name_mini'] == "七中一" || $WFNAME['class_name_mini'] == "八中一" || $WFNAME['class_name_mini'] == "九中一" || $WFNAME['class_name_mini'] == "十中一"){
	 	$ZHONGQIUHM = 0;
	 	if(strpos($OLD_TZ['tzhm'],$KJJG_1) !== false) $ZHONGQIUHM += 1;
	 	if(strpos($OLD_TZ['tzhm'],$KJJG_2) !== false) $ZHONGQIUHM += 1;
	 	if(strpos($OLD_TZ['tzhm'],$KJJG_3) !== false) $ZHONGQIUHM += 1;
	 	if(strpos($OLD_TZ['tzhm'],$KJJG_4) !== false) $ZHONGQIUHM += 1;
	 	if(strpos($OLD_TZ['tzhm'],$KJJG_5) !== false) $ZHONGQIUHM += 1;
	 	if(strpos($OLD_TZ['tzhm'],$KJJG_6) !== false) $ZHONGQIUHM += 1;
	 	if(strpos($OLD_TZ['tzhm'],$KJJG_7) !== false) $ZHONGQIUHM += 1;
	 	if($ZHONGQIUHM == 1) $ZJZS = 1;
	 }

	 if($WFNAME['class_name_mini'] == "正码过关") {
	     $prize_num = 0;
	     $spc_gg = 1;
	     $tzhm = explode(',',$OLD_TZ['tzhm']);
	     $tzhm_count = count($tzhm);
	     if(in_array($tzhm[0],zmgg_calculate($KJJG_1))) $prize_num += 1;
	     if(in_array($tzhm[1],zmgg_calculate($KJJG_2))) $prize_num += 1;
	     if(in_array($tzhm[2],zmgg_calculate($KJJG_3))) $prize_num += 1;
	     if(in_array($tzhm[3],zmgg_calculate($KJJG_4))) $prize_num += 1;
	     if(in_array($tzhm[4],zmgg_calculate($KJJG_5))) $prize_num += 1;
	     if(in_array($tzhm[5],zmgg_calculate($KJJG_6))) $prize_num += 1;
	     if(($tzhm[0]=='大' ||  $tzhm[0]=='小' ) && $KJJG_1==49) {
	         $prize_num += 1;
	         $spc_gg = 1.76;
	     } elseif(($tzhm[1]=='大' ||  $tzhm[1]=='小' ) && $KJJG_2==49) {
	         $prize_num += 1;
	         $spc_gg = 1.76;
	     } elseif(($tzhm[2]=='大' ||  $tzhm[2]=='小' ) && $KJJG_3==49) {
	         $prize_num += 1;
	         $spc_gg = 1.76;
	     } elseif(($tzhm[3]=='大' ||  $tzhm[3]=='小' ) && $KJJG_4==49) {
	         $prize_num += 1;
	         $spc_gg = 1.76;
	     } elseif(($tzhm[4]=='大' ||  $tzhm[4]=='小' ) && $KJJG_5==49) {
	         $prize_num += 1;
	         $spc_gg = 1.76;
	     } elseif(($tzhm[5]=='大' ||  $tzhm[5]=='小' ) && $KJJG_6==49) {
	         $prize_num += 1;
	         $spc_gg = 1.76;
	     }
	     if(($tzhm_count == $prize_num) && ($tzhm_count >= 2)) $ZJZS = 1;
	 }
	 
	 
	 //结算中奖金额并且删除投注数据表转移到已结算表
	 
	 //定义试玩账号和内部账号  区分写入表
	 
	 $USER_CL=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='{$OLD_TZ[username]}'")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($USER_CL['nbzh']==1 || $USER_CL['swzh']==1)
	 {
		 
		 $MYSQL_NAME="kkty_touzhu_list_sw";
		 
	 }ELSE{
		 
		 $MYSQL_NAME="kkty_touzhu_list_ok";
		 
	 }
	 
	 //取出中奖金额
	 
	 IF($OLD_TZ['nbzh']==1){$TZMS_LH=1;}
	 
	 IF($OLD_TZ['nbzh']==2){$TZMS_LH=10;}
	 
	 IF($OLD_TZ['nbzh']==3){$TZMS_LH=100;}
	 
	 //中奖金额算法注释   投注赔率 除以2 乘以单注金额 乘以 中奖注数 除以 投注模式 （赔率*单注金额*中奖注数/投注模式）
	 $ZJJE=$OLD_TZ['dqpl']*$OLD_TZ['dzje']*$ZJZS/$TZMS_LH;
	 
	 //六合彩正肖结算
/* 	 if($WFNAME['wanfa']=="正肖_猪" || $WFNAME['wanfa']=="正肖_狗" || $WFNAME['wanfa']=="正肖_鸡" || $WFNAME['wanfa']=="正肖_猴" || $WFNAME['wanfa']=="正肖_羊" || $WFNAME['wanfa']=="正肖_马" || $WFNAME['wanfa']=="正肖_蛇" || $WFNAME['wanfa']=="正肖_龙" || $WFNAME['wanfa']=="正肖_兔" || $WFNAME['wanfa']=="正肖_虎" || $WFNAME['wanfa']=="正肖_牛" || $WFNAME['wanfa']=="正肖_鼠"){
	 	if($ZJZS>0){ 
	 		$ZJJE = (($OLD_TZ['dqpl']-1)*$ZJZS*$OLD_TZ['dzje']+$OLD_TZ['dzje'])/$TZMS_LH;
	    }
	 } */
	 //六合彩正码过关结算和值特殊处理
	 if(($WFNAME['wanfa']=='正码过关大') && $spc_gg != 1) {
	     $ZJJE=$ZJJE/$spc_gg;
	 }
	 $ZJJE = sprintf('%.2f',$ZJJE);
	 
	 //转移投注注单
	 $MYSQL_ZHIXING_YUJU_A="`id`,`czid`,`qihao`,`tzhm`,`tzje`,`dzje`,`tzzs`,`username`,`tzhje`,`zjje`,`ifqs`,`wfid`,`dqpl`,`xzfd`,`fdje`,`kjjg`,`zjzs`,`nbzh`,`tz_time`";
	 
	 $MYSQL_ZHIXING_YUJU_B="'".$OLD_TZ['id']."','".$OLD_TZ['czid']."','".$OLD_TZ['qihao']."','".$OLD_TZ['tzhm']."','".$OLD_TZ['tzje']."','".$OLD_TZ['dzje']."','".$OLD_TZ['tzzs']."','".$OLD_TZ['username']."','".$OLD_TZ['tzhje']."','{$ZJJE}','1','".$OLD_TZ['wfid']."','".$OLD_TZ['dqpl']."','".$OLD_TZ['xzfd']."','".$OLD_TZ['fdje']."','{$KJJG}','{$ZJZS}','".$OLD_TZ['nbzh']."','".$OLD_TZ[tz_time]."'";
		
	 try{ 
		$db_pdo_link->beginTransaction(); 
		$db_pdo_link->exec("INSERT INTO `{$MYSQL_NAME}` ($MYSQL_ZHIXING_YUJU_A) VALUES ($MYSQL_ZHIXING_YUJU_B)");
	 
		$db_pdo_link->exec("DELETE FROM `kkty_touzhu_list_no` WHERE id={$TZID}");
		 
		//判断中奖金额大于0.001 大于的话给用户增加金额
		 
		IF($ZJJE>0.001)
		{
			 
			$db_pdo_link->exec("UPDATE kkty_username SET `je`=`je` + '{$ZJJE}',`zjzje`=`zjzje`+'{$ZJJE}' WHERE id={$USER_CL['id']}");	
		}
		//发送消息
		$CZNMSD=$db_pdo_link->query("SELECT * FROM kkty_caipai_list WHERE id={$OLD_TZ['czid']}")->fetch(PDO::FETCH_ASSOC);
		 
		IF($CZNMSD['cp_name_new']==""){$CZNMSD['cp_name_new']=$CZNMSD['cp_name_old'];}
		 
		USER_FASONG($USER_CL['username'],"您投注的彩种：【{$CZNMSD['cp_name_new']}】第：【{$OLD_TZ['qihao']}】已开奖，中奖金额：【{$ZJJE}】元！");
		
		$db_pdo_link->commit(); 
		return true;
	 }catch(PDOException $e)
	 {
		$db_pdo_link->rollBack();
		return false;
	 }
	 
}

//六合彩正码过关计算方法
function zmgg_calculate($value) {
    if(!$value) return array();
    if($value == 49) {
        $res[] = '和';
    } else {
        if($value >= 25)  $res[] = '大';
        if($value <= 24)  $res[] = '小';
    }
    if(($value%2) != 0)  $res[] = '单';
    if(($value%2) == 0)  $res[] = '双';
    if((array_sum(str_split($value,1))) >= 7)  $res[] = '合大';
    if((array_sum(str_split($value,1))) <= 6)  $res[] = '合小';
    if((array_sum(str_split($value,1))%2) != 0)  $res[] = '合单';
    if((array_sum(str_split($value,1))%2) == 0)  $res[] = '合双';
    if(substr($value,-1) >= 5)  $res[] = '尾大';
    if(substr($value,-1) <= 4)  $res[] = '尾小';
    if(in_array($value,array('01','02','07','08','12','13','18','19','23','24','29','30','34','35','40','45','46')))  $res[] = '红';
    if(in_array($value,array('05','06','11','16','17','21','22','27','28','32','33','38','39','43','44','49')))  $res[] = '绿';
    if(in_array($value,array('03','04','09','10','14','15','20','25','26','31','36','37','41','42','47','48')))  $res[] = '蓝';
    return $res;
}

//------------------------------香港六合彩[已和前台玩法对比]----------------------------------------------------//


//七星彩投注注单结算公共类
//------------------------------七星彩[已和前台玩法对比]----------------------------------------------------//
FUNCTION QIXINGCAI_TOUZHUJIESUAN($TZID,$KJJG){
	 
	 GLOBAL $db_pdo_link;
	 
	 $OLD_TZ=$db_pdo_link->query("SELECT * FROM kkty_touzhu_list_no WHERE id={$TZID}")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($OLD_TZ['wfid']>0){
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_play_classify WHERE id={$OLD_TZ['wfid']}")->fetch(PDO::FETCH_ASSOC);
		 
	 }ELSE{
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_peilv WHERE wanfa='".$OLD_TZ['tzhm']."'")->fetch(PDO::FETCH_ASSOC);
		 
	 }
	 
	 $KJJG_1=SUBSTR($KJJG,0,1);
	 
	 $KJJG_2=SUBSTR($KJJG,1,1);
	 
	 $KJJG_3=SUBSTR($KJJG,2,1);
	 
	 $KJJG_4=SUBSTR($KJJG,3,1);
	 
	 $KJJG_5=SUBSTR($KJJG,4,1);
	 
	 $KJJG_6=SUBSTR($KJJG,5,1);
	 
	 $KJJG_7=SUBSTR($KJJG,6,1);
	 
	 IF($WFNAME['class_name_mini']=="七星直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==7){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
					 
						 IF(STRSTR($HMARAY[3],$KJJG_4) !== false){
							 
							 IF(STRSTR($HMARAY[4],$KJJG_5) !== false){
								 
								 IF(STRSTR($HMARAY[5],$KJJG_6) !== false){
									 
									 IF(STRSTR($HMARAY[6],$KJJG_7) !== false){
										 
										 $ZJZS=$ZJZS+1;
										 
									 }
									 
								 }
								 
							 }
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="前六直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==6){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
					 
						 IF(STRSTR($HMARAY[3],$KJJG_4) !== false){
							 
							 IF(STRSTR($HMARAY[4],$KJJG_5) !== false){
								 
								 IF(STRSTR($HMARAY[5],$KJJG_6) !== false){
									
									 $ZJZS=$ZJZS+1;
									 
								 }
								 
							 }
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="后六直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==6){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_2) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_3) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_4) !== false){
					 
						 IF(STRSTR($HMARAY[3],$KJJG_5) !== false){
							 
							 IF(STRSTR($HMARAY[4],$KJJG_6) !== false){
								 
								 IF(STRSTR($HMARAY[5],$KJJG_7) !== false){
									
									 $ZJZS=$ZJZS+1;
									 
								 }
								 
							 }
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="前五直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==5){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
					 
						 IF(STRSTR($HMARAY[3],$KJJG_4) !== false){
							 
							 IF(STRSTR($HMARAY[4],$KJJG_5) !== false){
								
								 $ZJZS=$ZJZS+1;
								 
							 }
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="后五直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==5){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_3) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_4) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_5) !== false){
					 
						 IF(STRSTR($HMARAY[3],$KJJG_6) !== false){
							 
							 IF(STRSTR($HMARAY[4],$KJJG_7) !== false){
								
								 $ZJZS=$ZJZS+1;
								 
							 }
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="前四直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==4){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
					 
						 IF(STRSTR($HMARAY[3],$KJJG_4) !== false){
							
							 $ZJZS=$ZJZS+1;
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="后四直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==4){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_4) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_5) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_6) !== false){
					 
						 IF(STRSTR($HMARAY[3],$KJJG_7) !== false){
							
							 $ZJZS=$ZJZS+1;
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="前三直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==3){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
					 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="中三直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==3){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_3) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_4) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_5) !== false){
					 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="后三直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==3){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_5) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_6) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_7) !== false){
					 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="前二直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==2){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					
					 $ZJZS=$ZJZS+1;
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="后二直选"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==2){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_6) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_7) !== false){
					
					 $ZJZS=$ZJZS+1;
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="七星定位胆"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==7){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF(STRSTR($HMARAY[3],$KJJG_4) !== false){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF(STRSTR($HMARAY[4],$KJJG_5) !== false){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF(STRSTR($HMARAY[5],$KJJG_6) !== false){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF(STRSTR($HMARAY[6],$KJJG_7) !== false){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
		 
	 }
	 
	 //结算中奖金额并且删除投注数据表转移到已结算表
	 
	 //定义试玩账号和内部账号  区分写入表
	 
	 $USER_CL=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='".$OLD_TZ[username]."'")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($USER_CL['nbzh']==1 || $USER_CL['swzh']==1){
		 
		 $MYSQL_NAME="kkty_touzhu_list_sw";
		 
	 }ELSE{
		 
		 $MYSQL_NAME="kkty_touzhu_list_ok";
		 
	 }
	 
	 //取出中奖金额
	 
	 IF($OLD_TZ['nbzh']==1){$TZMS_LH=1;}
	 
	 IF($OLD_TZ['nbzh']==2){$TZMS_LH=10;}
	 
	 IF($OLD_TZ['nbzh']==3){$TZMS_LH=100;}
	 
	 //中奖金额算法注释   投注赔率 除以2 乘以单注金额 乘以 中奖注数 除以 投注模式 （赔率*单注金额*中奖注数/投注模式）
	 
	 $ZJJE=$OLD_TZ['dqpl']*$OLD_TZ['dzje']*$ZJZS/$TZMS_LH;
	
	 //转移投注注单
	 
	 $MYSQL_ZHIXING_YUJU_A="`id`,`czid`,`qihao`,`tzhm`,`tzje`,`dzje`,`tzzs`,`username`,`tzhje`,`zjje`,`ifqs`,`wfid`,`dqpl`,`xzfd`,`fdje`,`kjjg`,`zjzs`,`nbzh`,`tz_time`";
	 
	 $MYSQL_ZHIXING_YUJU_B="'".$OLD_TZ['id']."','".$OLD_TZ['czid']."','".$OLD_TZ['qihao']."','".$OLD_TZ['tzhm']."','".$OLD_TZ['tzje']."','".$OLD_TZ['dzje']."','".$OLD_TZ['tzzs']."','".$OLD_TZ['username']."','".$OLD_TZ['tzhje']."','{$ZJJE}','1','".$OLD_TZ['wfid']."','".$OLD_TZ['dqpl']."','".$OLD_TZ['xzfd']."','".$OLD_TZ['fdje']."','{$KJJG}','{$ZJZS}','".$OLD_TZ['nbzh']."','".$OLD_TZ['tz_time']."'";
	 
	  try{ 
		$db_pdo_link->beginTransaction(); 
		$db_pdo_link->exec("INSERT INTO `{$MYSQL_NAME}` ($MYSQL_ZHIXING_YUJU_A) VALUES ($MYSQL_ZHIXING_YUJU_B)");
	 
		$db_pdo_link->exec("DELETE FROM `kkty_touzhu_list_no` WHERE id={$TZID}");
		 
		//判断中奖金额大于0.001 大于的话给用户增加金额
		 
		IF($ZJJE>0.001)
		{
			 
			$db_pdo_link->exec("UPDATE kkty_username SET `je`=`je` + '{$ZJJE}',`zjzje`=`zjzje`+'{$ZJJE}' WHERE id={$USER_CL['id']}");	
		}
		//发送消息
		$CZNMSD=$db_pdo_link->query("SELECT * FROM kkty_caipai_list WHERE id={$OLD_TZ['czid']}")->fetch(PDO::FETCH_ASSOC);
		 
		IF($CZNMSD['cp_name_new']==""){$CZNMSD['cp_name_new']=$CZNMSD['cp_name_old'];}
		 
		USER_FASONG($USER_CL['username'],"您投注的彩种：【{$CZNMSD['cp_name_new']}】第：【{$OLD_TZ['qihao']}】已开奖，中奖金额：【{$ZJJE}】元！");
		
		$db_pdo_link->commit(); 
		return true;
		
	 }catch(PDOException $e)
	 {
		$db_pdo_link->rollBack();
		return false;
	 } 
}
//------------------------------七星彩[已和前台玩法对比]----------------------------------------------------//


//上海时时乐投注注单结算公共类

FUNCTION SHSSL_TOUZHUJIESUAN($TZID,$KJJG){
	 
	 GLOBAL $db_pdo_link;
	 
	 $OLD_TZ=$db_pdo_link->query("SELECT * FROM kkty_touzhu_list_no WHERE id={$TZID}")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($OLD_TZ['wfid']>0){
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_play_classify where id={$OLD_TZ['wfid']}")->fetch(PDO::FETCH_ASSOC);
		 
	 }ELSE{
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_peilv WHERE wanfa='".$OLD_TZ['tzhm']."'")->fetch(PDO::FETCH_ASSOC);
		 
	 }
	 
	 $KJJG_1=SUBSTR($KJJG,0,1);
	 
	 $KJJG_2=SUBSTR($KJJG,1,1);
	 
	 $KJJG_3=SUBSTR($KJJG,2,1);
	 
	 IF($WFNAME['class_name_mini']=="三码直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==3){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
					 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="三码组选组三"){
	 	
	 	if(($KJJG_1==$KJJG_2 && $KJJG_1!=$KJJG_3) || ($KJJG_2==$KJJG_3 && $KJJG_1!=$KJJG_2) || ($KJJG_1==$KJJG_3 && $KJJG_1!=$KJJG_2)){
		 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1) !== false){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2) !== false){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3) !== false){
					 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
	 	}
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="三码组选组六"){
	 	 
	 	if($KJJG_1!=$KJJG_2 && $KJJG_1!=$KJJG_3 && $KJJG_2 != $KJJG_3){
	 			
	 		IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1) !== false){
	 				
	 			IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2) !== false){
	 
	 				IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3) !== false){
	 
	 					$ZJZS=$ZJZS+1;
	 						
	 				}
	 
	 			}
	 				
	 		}
	 	}
	 		
	 }
	 
	 IF($WFNAME['class_name_mini']=="后二码直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==2){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_2) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_3) !== false){
				 
					 $ZJZS=$ZJZS+1;
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="前二码直选复式"){
	 		
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 		
	 	IF(COUNT($HMARAY)==2){
	 
	 		IF(STRSTR($HMARAY[0],$KJJG_2) !== false){
	 				
	 			IF(STRSTR($HMARAY[1],$KJJG_1) !== false){
	 					
	 				$ZJZS=$ZJZS+1;
	 
	 			}
	 				
	 		}
	 
	 	}
	 		
	 }
	 if($WFNAME['class_name_mini']=="后二码直选和值"){
	 	$zh = $KJJG_2+$KJJG_3;
	 	if(strstr($OLD_TZ['tzhm'], $zh) !== false){
	 		$ZJZS =$ZJZS+1;
	 	}
	 }
	 if($WFNAME['class_name_mini']=="前二码直选和值"){
	 	$zh = $KJJG_2+$KJJG_1;
	 	if(strstr($OLD_TZ['tzhm'], $zh) !== false){
	 		$ZJZS =$ZJZS+1;
	 	}
	 }
	 IF($WFNAME['class_name_mini']=="后二码组选复式"){
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2) !== false){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3) !== false){
			 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="前二码组选复式"){
	 		
	 	IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2) !== false){
	 
	 		IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 				
	 		}
	 
	 	}
	 		
	 }

	 IF($WFNAME['class_name_mini']=="一码不定胆"){

	 	$OLD = explode(' ', $OLD_TZ['tzhm']);
	 	
	 	for ($i=0;$i<count($OLD);$i++){
	 		
	 		IF((STRSTR($OLD[$i],$KJJG_1) !== false) || (STRSTR($OLD[$i],$KJJG_2) !== false) || (STRSTR($OLD[$i],$KJJG_3) !== false)){
	 				
	 			$ZJZS+=1;
	 		
	 		}
	 	}
		 
	 }
	 
	 
	 IF($WFNAME['class_name_mini']=="定位胆"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==3){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 $ZJZS=$ZJZS+1;
			 }
			 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
				 
				 $ZJZS=$ZJZS+1;
			 }
			 IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
				 
				 $ZJZS=$ZJZS+1;
			 }
			 
			 
		 }
		 
	 }
	 
	 
	 
	 //结算中奖金额并且删除投注数据表转移到已结算表
	 
	 //定义试玩账号和内部账号  区分写入表
	 
	 $USER_CL=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='".$OLD_TZ[username]."'")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($USER_CL['nbzh']==1 || $USER_CL['swzh']==1){
		 
		 $MYSQL_NAME="kkty_touzhu_list_sw";
		 
	 }ELSE{
		 
		 $MYSQL_NAME="kkty_touzhu_list_ok";
		 
	 }
	 
	 //取出中奖金额
	 
	 IF($OLD_TZ['nbzh']==1){$TZMS_LH=1;}
	 
	 IF($OLD_TZ['nbzh']==2){$TZMS_LH=10;}
	 
	 IF($OLD_TZ['nbzh']==3){$TZMS_LH=100;}
	 
	 //中奖金额算法注释   投注赔率 除以2 乘以单注金额 乘以 中奖注数 除以 投注模式 （赔率*单注金额*中奖注数/投注模式）
	 
	 $ZJJE=$OLD_TZ['dqpl']*$OLD_TZ['dzje']*$ZJZS/$TZMS_LH;
	
	 //转移投注注单
	 
	 $MYSQL_ZHIXING_YUJU_A="`id`,`czid`,`qihao`,`tzhm`,`tzje`,`dzje`,`tzzs`,`username`,`tzhje`,`zjje`,`ifqs`,`wfid`,`dqpl`,`xzfd`,`fdje`,`kjjg`,`zjzs`,`nbzh`,`tz_time`";
	 
	 
	 $MYSQL_ZHIXING_YUJU_B="'".$OLD_TZ['id']."','".$OLD_TZ['czid']."','".$OLD_TZ['qihao']."','".$OLD_TZ['tzhm']."','".$OLD_TZ['tzje']."','".$OLD_TZ['dzje']."','".$OLD_TZ['tzzs']."','".$OLD_TZ['username']."','".$OLD_TZ['tzhje']."','{$ZJJE}','1','".$OLD_TZ['wfid']."','".$OLD_TZ['dqpl']."','".$OLD_TZ['xzfd']."','".$OLD_TZ['fdje']."','{$KJJG}','{$ZJZS}','".$OLD_TZ['nbzh']."','".$OLD_TZ['tz_time']."'";
	 
	  try{ 
		$db_pdo_link->beginTransaction(); 
		$db_pdo_link->exec("INSERT INTO `{$MYSQL_NAME}` ($MYSQL_ZHIXING_YUJU_A) VALUES ($MYSQL_ZHIXING_YUJU_B)");
	 
		$db_pdo_link->exec("DELETE FROM `kkty_touzhu_list_no` WHERE id={$TZID}");
		 
		//判断中奖金额大于0.001 大于的话给用户增加金额
		 
		IF($ZJJE>0.001)
		{
			 
			$db_pdo_link->exec("UPDATE kkty_username SET `je`=`je` + '{$ZJJE}',`zjzje`=`zjzje`+'{$ZJJE}' WHERE id={$USER_CL['id']}");	
		}
		//发送消息
		$CZNMSD=$db_pdo_link->query("SELECT * FROM kkty_caipai_list WHERE id={$OLD_TZ['czid']}")->fetch(PDO::FETCH_ASSOC);
		 
		IF($CZNMSD['cp_name_new']==""){$CZNMSD['cp_name_new']=$CZNMSD['cp_name_old'];}
		 
		USER_FASONG($USER_CL['username'],"您投注的彩种：【{$CZNMSD['cp_name_new']}】第：【{$OLD_TZ['qihao']}】已开奖，中奖金额：【{$ZJJE}】元！");
		
		$db_pdo_link->commit(); 
		return true;
		
	 }catch(PDOException $e)
	 {
		$db_pdo_link->rollBack();
		return false;
	 } 
}

//快乐十分投注注单结算公共类


//========================================快乐10分=======================================================

FUNCTION GDKLS_TOUZHUJIESUAN($TZID,$KJJG){
	 
	 GLOBAL $db_pdo_link;
	 
	 $OLD_TZ=$db_pdo_link->query("SELECT * FROM kkty_touzhu_list_no WHERE id={$TZID}")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($OLD_TZ['wfid']>0){
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_peilv WHERE id={$OLD_TZ['wfid']}")->fetch(PDO::FETCH_ASSOC);
		 
	 }ELSE{
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_peilv WHERE wanfa='".$OLD_TZ['tzhm']."'")->fetch(PDO::FETCH_ASSOC);
		 
	 }
	 
	 $KJJG_1=SUBSTR($KJJG,0,2);
	 
	 $KJJG_2=SUBSTR($KJJG,2,2);
	 
	 $KJJG_3=SUBSTR($KJJG,4,2);
	 
	 $KJJG_4=SUBSTR($KJJG,6,2);
	 
	 $KJJG_5=SUBSTR($KJJG,8,2);
	 
	 $KJJG_6=SUBSTR($KJJG,10,2);
	 
	 $KJJG_7=SUBSTR($KJJG,12,2);
	 
	 $KJJG_8=SUBSTR($KJJG,14,2);
	 
	 $KJJG_1_1=SUBSTR($KJJG_1,0,1)+SUBSTR($KJJG_1,1,1);
	 
	 $KJJG_2_1=SUBSTR($KJJG_2,0,1)+SUBSTR($KJJG_2,1,1);
	 
	 $KJJG_3_1=SUBSTR($KJJG_3,0,1)+SUBSTR($KJJG_3,1,1);
	 
	 $KJJG_4_1=SUBSTR($KJJG_4,0,1)+SUBSTR($KJJG_4,1,1);
	 
	 $KJJG_5_1=SUBSTR($KJJG_5,0,1)+SUBSTR($KJJG_5,1,1);
	 
	 $KJJG_HE=$KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5+$KJJG_6+$KJJG_7+$KJJG_8;
	 
	 $KJJH_W_1=SUBSTR($KJJG_HE,0,1);
	 
	 $KJJH_W_2=SUBSTR($KJJG_HE,STRLEN($KJJG_HE)-1,1);
	 
	 IF($KJJG_HE<10){$KJJH_W_1="0";}ELSE{$KJJH_W_2=$KJJG_HE;}
	 
	 $ZJZS=0;
	 
	 $ZJJE=0;
	 
	 IF($WFNAME['wanfa']=="总单"){
		 
		 IF($OLD_TZ['tzhm']=="两面盘_总单"){
			 
			 IF($KJJG_HE%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 
	 }
	 IF($WFNAME['wanfa']=="总双"){
		 
		 IF($OLD_TZ['tzhm']=="两面盘_总双"){
			 
			 IF($KJJG_HE%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 
	 }
	 IF($WFNAME['wanfa']=="总大"){
		 
		 IF($OLD_TZ['tzhm']=="两面盘_总大"){
			 
			 IF($KJJG_HE>84){$ZJZS=$ZJZS+1;}
			 
		 }
		 
	 }
	 IF($WFNAME['wanfa']=="总小"){
		 
		 IF($OLD_TZ['tzhm']=="两面盘_总小"){
			 
			 IF($KJJG_HE<84){$ZJZS=$ZJZS+1;}
			 
		 }
		 
	 }
	 IF($WFNAME['wanfa']=="总尾大"){
		 
		 IF($OLD_TZ['tzhm']=="两面盘_总尾大"){
			 
			 IF($KJJH_W_2>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 
	 }
	 IF($WFNAME['wanfa']=="总尾小"){
		 
		 IF($OLD_TZ['tzhm']=="两面盘_总尾小"){
			 
			 IF($KJJH_W_2<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 
	 }
	 IF($WFNAME['wanfa']=="总龙"){
		 
		 IF($OLD_TZ['tzhm']=="两面盘_总龙"){
			 
			 IF($KJJH_W_1>$KJJH_W_2){$ZJZS=$ZJZS+1;}
			 
		 }
		 
	 }
	 IF($WFNAME['wanfa']=="总虎"){
		 
		 IF($OLD_TZ['tzhm']=="两面盘_总虎"){
			 
			 IF($KJJH_W_1<$KJJH_W_2){$ZJZS=$ZJZS+1;}
			 
		 }
		 
	 }
	 IF($WFNAME['wanfa']=="大"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_大"){
			 
			 IF($KJJG_1>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_大"){
			 
			 IF($KJJG_2>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_大"){
			 
			 IF($KJJG_3>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_大"){
			 
			 IF($KJJG_4>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_大"){
			 
			 IF($KJJG_5>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_大"){
			 
			 IF($KJJG_6>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_大"){
			 
			 IF($KJJG_7>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_大"){
			 
			 IF($KJJG_8>4){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="小"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_小"){
			 
			 IF($KJJG_1<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_小"){
			 
			 IF($KJJG_2<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_小"){
			 
			 IF($KJJG_3<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_小"){
			 
			 IF($KJJG_4<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_小"){
			 
			 IF($KJJG_5<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_小"){
			 
			 IF($KJJG_6<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_小"){
			 
			 IF($KJJG_7<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_小"){
			 
			 IF($KJJG_8<5){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="单"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_单"){
			 
			 IF($KJJG_1%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_单"){
			 
			 IF($KJJG_2%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_单"){
			 
			 IF($KJJG_3%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_单"){
			 
			 IF($KJJG_4%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_单"){
			 
			 IF($KJJG_5%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_单"){
			 
			 IF($KJJG_6%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_单"){
			 
			 IF($KJJG_7%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_单"){
			 
			 IF($KJJG_8%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="双"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_双"){
			 
			 IF($KJJG_1%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_双"){
			 
			 IF($KJJG_2%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_双"){
			 
			 IF($KJJG_3%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_双"){
			 
			 IF($KJJG_4%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_双"){
			 
			 IF($KJJG_5%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_双"){
			 
			 IF($KJJG_6%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_双"){
			 
			 IF($KJJG_7%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_双"){
			 
			 IF($KJJG_8%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="尾大"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_尾大"){
			 
			 IF(SUBSTR($KJJG_1,STRLEN($KJJG_1)-1,1)>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_尾大"){
			 
			 IF(SUBSTR($KJJG_2,STRLEN($KJJG_1)-1,1)>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_尾大"){
			 
			 IF(SUBSTR($KJJG_3,STRLEN($KJJG_1)-1,1)>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_尾大"){
			 
			 IF(SUBSTR($KJJG_4,STRLEN($KJJG_1)-1,1)>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_尾大"){
			 
			 IF(SUBSTR($KJJG_5,STRLEN($KJJG_1)-1,1)>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_尾大"){
			 
			 IF(SUBSTR($KJJG_6,STRLEN($KJJG_1)-1,1)>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_尾大"){
			 
			 IF(SUBSTR($KJJG_7,STRLEN($KJJG_1)-1,1)>4){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_尾大"){
			 
			 IF(SUBSTR($KJJG_8,STRLEN($KJJG_1)-1,1)>4){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="尾小"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_尾小"){
			 
			 IF(SUBSTR($KJJG_1,STRLEN($KJJG_1)-1,1)<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_尾小"){
			 
			 IF(SUBSTR($KJJG_2,STRLEN($KJJG_1)-1,1)<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_尾小"){
			 
			 IF(SUBSTR($KJJG_3,STRLEN($KJJG_1)-1,1)<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_尾小"){
			 
			 IF(SUBSTR($KJJG_4,STRLEN($KJJG_1)-1,1)<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_尾小"){
			 
			 IF(SUBSTR($KJJG_5,STRLEN($KJJG_1)-1,1)<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_尾小"){
			 
			 IF(SUBSTR($KJJG_6,STRLEN($KJJG_1)-1,1)<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_尾小"){
			 
			 IF(SUBSTR($KJJG_7,STRLEN($KJJG_1)-1,1)<5){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_尾小"){
			 
			 IF(SUBSTR($KJJG_8,STRLEN($KJJG_1)-1,1)<5){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="合单"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_合单"){
			 
			 IF($KJJG_1_1%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_合单"){
			 
			 IF($KJJG_2_1%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_合单"){
			 
			 IF($KJJG_3_1%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_合单"){
			 
			 IF($KJJG_4_1%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_合单"){
			 
			 IF($KJJG_5_1%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_合单"){
			 
			 IF($KJJG_6_1%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_合单"){
			 
			 IF($KJJG_7_1%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_合单"){
			 
			 IF($KJJG_8_1%2!=0){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="合双"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_合双"){
			 
			 IF($KJJG_1_1%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_合双"){
			 
			 IF($KJJG_2_1%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_合双"){
			 
			 IF($KJJG_3_1%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_合双"){
			 
			 IF($KJJG_4_1%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_合双"){
			 
			 IF($KJJG_5_1%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_合双"){
			 
			 IF($KJJG_6_1%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_合双"){
			 
			 IF($KJJG_7_1%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_合双"){
			 
			 IF($KJJG_8_1%2==0){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="龙"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_龙"){
			 
			 IF($KJJG_1<10){$KJJG_1="0".$KJJG_1;}
			 
			 IF(SUBSTR($KJJG_1,0,1)>SUBSTR($KJJG_1,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_龙"){
			 
			 IF($KJJG_2<10){$KJJG_2="0".$KJJG_2;}
			 
			 IF(SUBSTR($KJJG_2,0,1)>SUBSTR($KJJG_2,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_龙"){
			 
			 IF($KJJG_3<10){$KJJG_3="0".$KJJG_3;}
			 
			 IF(SUBSTR($KJJG_3,0,1)>SUBSTR($KJJG_3,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_龙"){
			 
			 IF($KJJG_4<10){$KJJG_4="0".$KJJG_4;}
			 
			 IF(SUBSTR($KJJG_4,0,1)>SUBSTR($KJJG_4,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_龙"){
			 
			 IF($KJJG_5<10){$KJJG_5="0".$KJJG_5;}
			 
			 IF(SUBSTR($KJJG_5,0,1)>SUBSTR($KJJG_5,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_龙"){
			 
			 IF($KJJG_6<10){$KJJG_6="0".$KJJG_6;}
			 
			 IF(SUBSTR($KJJG_6,0,1)>SUBSTR($KJJG_6,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_龙"){
			 
			 IF($KJJG_7<10){$KJJG_7="0".$KJJG_7;}
			 
			 IF(SUBSTR($KJJG_7,0,1)>SUBSTR($KJJG_7,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_龙"){
			 
			 IF($KJJG_8<10){$KJJG_8="0".$KJJG_8;}
			 
			 IF(SUBSTR($KJJG_8,0,1)>SUBSTR($KJJG_8,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="虎"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_虎"){
			 
			 IF($KJJG_1<10){$KJJG_1="0".$KJJG_1;}
			 
			 IF(SUBSTR($KJJG_1,0,1)<SUBSTR($KJJG_1,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_虎"){
			 
			 IF($KJJG_2<10){$KJJG_2="0".$KJJG_2;}
			 
			 IF(SUBSTR($KJJG_2,0,1)<SUBSTR($KJJG_2,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_虎"){
			 
			 IF($KJJG_3<10){$KJJG_3="0".$KJJG_3;}
			 
			 IF(SUBSTR($KJJG_3,0,1)<SUBSTR($KJJG_3,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_虎"){
			 
			 IF($KJJG_4<10){$KJJG_4="0".$KJJG_4;}
			 
			 IF(SUBSTR($KJJG_4,0,1)<SUBSTR($KJJG_4,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_虎"){
			 
			 IF($KJJG_5<10){$KJJG_5="0".$KJJG_5;}
			 
			 IF(SUBSTR($KJJG_5,0,1)<SUBSTR($KJJG_5,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_虎"){
			 
			 IF($KJJG_6<10){$KJJG_6="0".$KJJG_6;}
			 
			 IF(SUBSTR($KJJG_6,0,1)<SUBSTR($KJJG_6,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_虎"){
			 
			 IF($KJJG_7<10){$KJJG_7="0".$KJJG_7;}
			 
			 IF(SUBSTR($KJJG_7,0,1)<SUBSTR($KJJG_7,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_虎"){
			 
			 IF($KJJG_8<10){$KJJG_8="0".$KJJG_8;}
			 
			 IF(SUBSTR($KJJG_8,0,1)<SUBSTR($KJJG_8,1,1)){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="01"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_01"){
			 
			 IF($KJJG_1=="01"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_01"){
			 
			 IF($KJJG_2=="01"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_01"){
			 
			 IF($KJJG_3=="01"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_01"){
			 
			 IF($KJJG_4=="01"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_01"){
			 
			 IF($KJJG_5=="01"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_01"){
			 
			 IF($KJJG_6=="01"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_01"){
			 
			 IF($KJJG_7=="01"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_01"){
			 
			 IF($KJJG_8=="01"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="02"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_02"){
			 
			 IF($KJJG_1=="02"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_02"){
			 
			 IF($KJJG_2=="02"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_02"){
			 
			 IF($KJJG_3=="02"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_02"){
			 
			 IF($KJJG_4=="02"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_02"){
			 
			 IF($KJJG_5=="02"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_02"){
			 
			 IF($KJJG_6=="02"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_02"){
			 
			 IF($KJJG_7=="02"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_02"){
			 
			 IF($KJJG_8=="02"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="03"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_03"){
			 
			 IF($KJJG_1=="03"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_03"){
			 
			 IF($KJJG_2=="03"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_03"){
			 
			 IF($KJJG_3=="03"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_03"){
			 
			 IF($KJJG_4=="03"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_03"){
			 
			 IF($KJJG_5=="03"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_03"){
			 
			 IF($KJJG_6=="03"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_03"){
			 
			 IF($KJJG_7=="03"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_03"){
			 
			 IF($KJJG_8=="03"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="04"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_04"){
			 
			 IF($KJJG_1=="04"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_04"){
			 
			 IF($KJJG_2=="04"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_04"){
			 
			 IF($KJJG_3=="04"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_04"){
			 
			 IF($KJJG_4=="04"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_04"){
			 
			 IF($KJJG_5=="04"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_04"){
			 
			 IF($KJJG_6=="04"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_04"){
			 
			 IF($KJJG_7=="04"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_04"){
			 
			 IF($KJJG_8=="04"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="05"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_05"){
			 
			 IF($KJJG_1=="05"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_05"){
			 
			 IF($KJJG_2=="05"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_05"){
			 
			 IF($KJJG_3=="05"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_05"){
			 
			 IF($KJJG_4=="05"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_05"){
			 
			 IF($KJJG_5=="05"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_05"){
			 
			 IF($KJJG_6=="05"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_05"){
			 
			 IF($KJJG_7=="05"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_05"){
			 
			 IF($KJJG_8=="05"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="06"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_06"){
			 
			 IF($KJJG_1=="06"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_06"){
			 
			 IF($KJJG_2=="06"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_06"){
			 
			 IF($KJJG_3=="06"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_06"){
			 
			 IF($KJJG_4=="06"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_06"){
			 
			 IF($KJJG_5=="06"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_06"){
			 
			 IF($KJJG_6=="06"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_06"){
			 
			 IF($KJJG_7=="06"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_06"){
			 
			 IF($KJJG_8=="06"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="07"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_07"){
			 
			 IF($KJJG_1=="07"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_07"){
			 
			 IF($KJJG_2=="07"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_07"){
			 
			 IF($KJJG_3=="07"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_07"){
			 
			 IF($KJJG_4=="07"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_07"){
			 
			 IF($KJJG_5=="07"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_07"){
			 
			 IF($KJJG_6=="07"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_07"){
			 
			 IF($KJJG_7=="07"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_07"){
			 
			 IF($KJJG_8=="07"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="08"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_08"){
			 
			 IF($KJJG_1=="08"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_08"){
			 
			 IF($KJJG_2=="08"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_08"){
			 
			 IF($KJJG_3=="08"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_08"){
			 
			 IF($KJJG_4=="08"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_08"){
			 
			 IF($KJJG_5=="08"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_08"){
			 
			 IF($KJJG_6=="08"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_08"){
			 
			 IF($KJJG_7=="08"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_08"){
			 
			 IF($KJJG_8=="08"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="09"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_09"){
			 
			 IF($KJJG_1=="09"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_09"){
			 
			 IF($KJJG_2=="09"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_09"){
			 
			 IF($KJJG_3=="09"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_09"){
			 
			 IF($KJJG_4=="09"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_09"){
			 
			 IF($KJJG_5=="09"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_09"){
			 
			 IF($KJJG_6=="09"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_09"){
			 
			 IF($KJJG_7=="09"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_09"){
			 
			 IF($KJJG_8=="09"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="10"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_10"){
			 
			 IF($KJJG_1=="10"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_10"){
			 
			 IF($KJJG_2=="10"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_10"){
			 
			 IF($KJJG_3=="10"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_10"){
			 
			 IF($KJJG_4=="10"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_10"){
			 
			 IF($KJJG_5=="10"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_10"){
			 
			 IF($KJJG_6=="10"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_10"){
			 
			 IF($KJJG_7=="10"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_10"){
			 
			 IF($KJJG_8=="10"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="11"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_11"){
			 
			 IF($KJJG_1=="11"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_11"){
			 
			 IF($KJJG_2=="11"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_11"){
			 
			 IF($KJJG_3=="11"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_11"){
			 
			 IF($KJJG_4=="11"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_11"){
			 
			 IF($KJJG_5=="11"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_11"){
			 
			 IF($KJJG_6=="11"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_11"){
			 
			 IF($KJJG_7=="11"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_11"){
			 
			 IF($KJJG_8=="11"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="12"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_12"){
			 
			 IF($KJJG_1=="12"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_12"){
			 
			 IF($KJJG_2=="12"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_12"){
			 
			 IF($KJJG_3=="12"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_12"){
			 
			 IF($KJJG_4=="12"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_12"){
			 
			 IF($KJJG_5=="12"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_12"){
			 
			 IF($KJJG_6=="12"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_12"){
			 
			 IF($KJJG_7=="12"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_12"){
			 
			 IF($KJJG_8=="12"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="13"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_13"){
			 
			 IF($KJJG_1=="13"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_13"){
			 
			 IF($KJJG_2=="13"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_13"){
			 
			 IF($KJJG_3=="13"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_13"){
			 
			 IF($KJJG_4=="13"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_13"){
			 
			 IF($KJJG_5=="13"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_13"){
			 
			 IF($KJJG_6=="13"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_13"){
			 
			 IF($KJJG_7=="13"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_13"){
			 
			 IF($KJJG_8=="13"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="14"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_14"){
			 
			 IF($KJJG_1=="14"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_14"){
			 
			 IF($KJJG_2=="14"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_14"){
			 
			 IF($KJJG_3=="14"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_14"){
			 
			 IF($KJJG_4=="14"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_14"){
			 
			 IF($KJJG_5=="14"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_14"){
			 
			 IF($KJJG_6=="14"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_14"){
			 
			 IF($KJJG_7=="14"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_14"){
			 
			 IF($KJJG_8=="14"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="15"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_15"){
			 
			 IF($KJJG_1=="15"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_15"){
			 
			 IF($KJJG_2=="15"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_15"){
			 
			 IF($KJJG_3=="15"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_15"){
			 
			 IF($KJJG_4=="15"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_15"){
			 
			 IF($KJJG_5=="15"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_15"){
			 
			 IF($KJJG_6=="15"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_15"){
			 
			 IF($KJJG_7=="15"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_15"){
			 
			 IF($KJJG_8=="15"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="16"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_16"){
			 
			 IF($KJJG_1=="16"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_16"){
			 
			 IF($KJJG_2=="16"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_16"){
			 
			 IF($KJJG_3=="16"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_16"){
			 
			 IF($KJJG_4=="16"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_16"){
			 
			 IF($KJJG_5=="16"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_16"){
			 
			 IF($KJJG_6=="16"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_16"){
			 
			 IF($KJJG_7=="16"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_16"){
			 
			 IF($KJJG_8=="16"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="17"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_17"){
			 
			 IF($KJJG_1=="17"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_17"){
			 
			 IF($KJJG_2=="17"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_17"){
			 
			 IF($KJJG_3=="17"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_17"){
			 
			 IF($KJJG_4=="17"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_17"){
			 
			 IF($KJJG_5=="17"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_17"){
			 
			 IF($KJJG_6=="17"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_17"){
			 
			 IF($KJJG_7=="17"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_17"){
			 
			 IF($KJJG_8=="17"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="18"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_18"){
			 
			 IF($KJJG_1=="18"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_18"){
			 
			 IF($KJJG_2=="18"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_18"){
			 
			 IF($KJJG_3=="18"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_18"){
			 
			 IF($KJJG_4=="18"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_18"){
			 
			 IF($KJJG_5=="18"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_18"){
			 
			 IF($KJJG_6=="18"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_18"){
			 
			 IF($KJJG_7=="18"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_18"){
			 
			 IF($KJJG_8=="18"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="19"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_19"){
			 
			 IF($KJJG_1=="19"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_19"){
			 
			 IF($KJJG_2=="19"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_19"){
			 
			 IF($KJJG_3=="19"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_19"){
			 
			 IF($KJJG_4=="19"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_19"){
			 
			 IF($KJJG_5=="19"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_19"){
			 
			 IF($KJJG_6=="19"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_19"){
			 
			 IF($KJJG_7=="19"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_19"){
			 
			 IF($KJJG_8=="19"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 IF($WFNAME['wanfa']=="20"){
		 
		 IF($OLD_TZ['tzhm']=="第一球_20"){
			 
			 IF($KJJG_1=="20"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第二球_20"){
			 
			 IF($KJJG_2=="20"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第三球_20"){
			 
			 IF($KJJG_3=="20"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第四球_20"){
			 
			 IF($KJJG_4=="20"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第五球_20"){
			 
			 IF($KJJG_5=="20"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第六球_20"){
			 
			 IF($KJJG_6=="20"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第七球_20"){
			 
			 IF($KJJG_7=="20"){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="第八球_20"){
			 
			 IF($KJJG_8=="20"){$ZJZS=$ZJZS+1;}
			 
		 }
	 }
	 
	 
	 
	 
	 //结算中奖金额并且删除投注数据表转移到已结算表
	 
	 //定义试玩账号和内部账号  区分写入表
	 
	 $USER_CL=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='".$OLD_TZ['username']."'")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($USER_CL['nbzh']==1 || $USER_CL['swzh']==1){
		 
		 $MYSQL_NAME="kkty_touzhu_list_sw";
		 
	 }ELSE{
		 
		 $MYSQL_NAME="kkty_touzhu_list_ok";
		 
	 }
	 
	 //取出中奖金额
	 
	 IF($OLD_TZ['nbzh']==1){$TZMS_LH=1;}
	 
	 IF($OLD_TZ['nbzh']==2){$TZMS_LH=10;}
	 
	 IF($OLD_TZ['nbzh']==3){$TZMS_LH=100;}
	 
	 //中奖金额算法注释   投注赔率 除以2 乘以单注金额 乘以 中奖注数 除以 投注模式 （赔率*单注金额*中奖注数/投注模式）
	 
	 $ZJJE=$OLD_TZ['dqpl']*$OLD_TZ['dzje']*$ZJZS/$TZMS_LH;
	
	 //转移投注注单
	 
	 $MYSQL_ZHIXING_YUJU_A="`id`,`czid`,`qihao`,`tzhm`,`tzje`,`dzje`,`tzzs`,`username`,`tzhje`,`zjje`,`ifqs`,`wfid`,`dqpl`,`xzfd`,`fdje`,`kjjg`,`zjzs`,`nbzh`,`tz_time`";
	 
	 $MYSQL_ZHIXING_YUJU_B="'".$OLD_TZ['id']."','".$OLD_TZ['czid']."','".$OLD_TZ['qihao']."','".$OLD_TZ['tzhm']."','".$OLD_TZ['tzje']."','".$OLD_TZ['dzje']."','".$OLD_TZ['tzzs']."','".$OLD_TZ['username']."','".$OLD_TZ['tzhje']."','{$ZJJE}','1','".$OLD_TZ['wfid']."','".$OLD_TZ['dqpl']."','".$OLD_TZ['xzfd']."','".$OLD_TZ['fdje']."','{$KJJG}','{$ZJZS}','".$OLD_TZ['nbzh']."','".$OLD_TZ['tz_time']."'";
	 
	 
	 try{ 
		$db_pdo_link->beginTransaction(); 
		$db_pdo_link->exec("INSERT INTO `{$MYSQL_NAME}` ($MYSQL_ZHIXING_YUJU_A) VALUES ($MYSQL_ZHIXING_YUJU_B)");
	 
		$db_pdo_link->exec("DELETE FROM `kkty_touzhu_list_no` WHERE id={$TZID}");
		 
		//判断中奖金额大于0.001 大于的话给用户增加金额
		 
		IF($ZJJE>0.001)
		{
			 
			$db_pdo_link->exec("UPDATE kkty_username SET `je`=`je` + '{$ZJJE}',`zjzje`=`zjzje`+'{$ZJJE}' WHERE id={$USER_CL['id']}");	
		}
		//发送消息
		$CZNMSD=$db_pdo_link->query("SELECT * FROM kkty_caipai_list WHERE id={$OLD_TZ['czid']}")->fetch(PDO::FETCH_ASSOC);
		 
		IF($CZNMSD['cp_name_new']==""){$CZNMSD['cp_name_new']=$CZNMSD['cp_name_old'];}
		 
		USER_FASONG($USER_CL['username'],"您投注的彩种：【{$CZNMSD['cp_name_new']}】第：【{$OLD_TZ['qihao']}】已开奖，中奖金额：【{$ZJJE}】元！");
		
		$db_pdo_link->commit(); 
		return true;
	 }catch(PDOException $e)
	 {
		$db_pdo_link->rollBack();
		return false;
	 } 
}

//========================================快乐10分=======================================================

//北京赛车投注注单结算公共类

//---------------------------------------北京赛车---------------------------------------------------------
FUNCTION PK10_TOUZHUJIESUAN($TZID,$KJJG){
	 
	 GLOBAL $db_pdo_link;
	 
	 $OLD_TZ=$db_pdo_link->query("SELECT * FROM kkty_touzhu_list_no WHERE id={$TZID}")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($OLD_TZ['wfid']>0){
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_play_classify WHERE id={$OLD_TZ['wfid']}")->fetch(PDO::FETCH_ASSOC);
		 
	 }ELSE{
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_peilv WHERE wanfa='".$OLD_TZ['tzhm']."'")->fetch(PDO::FETCH_ASSOC);
		 
	 }
	 
	 $KJJG_1=SUBSTR($KJJG,0,2);
	 
	 $KJJG_2=SUBSTR($KJJG,2,2);
	 
	 $KJJG_3=SUBSTR($KJJG,4,2);
	 
	 $KJJG_4=SUBSTR($KJJG,6,2);
	 
	 $KJJG_5=SUBSTR($KJJG,8,2);
	 
	 $KJJG_6=SUBSTR($KJJG,10,2);
	 
	 $KJJG_7=SUBSTR($KJJG,12,2);
	 
	 $KJJG_8=SUBSTR($KJJG,14,2);
	 
	 $KJJG_9=SUBSTR($KJJG,16,2);
	 
	 $KJJG_10=SUBSTR($KJJG,18,2);
	 
	 $ZJZS=0;
	 
	 $ZJJE=0;
	 
	 IF($WFNAME['class_name_mini']=="前一"){
		  
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="前二"){
		  
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(STRSTR($HMARAY[0],$KJJG_1)){
			 
			 IF(STRSTR($HMARAY[1],$KJJG_2)){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="前三复式"){
		  
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(STRSTR($HMARAY[0],$KJJG_1)){
			 
			 IF(STRSTR($HMARAY[1],$KJJG_2)){
				 
				 IF(STRSTR($HMARAY[2],$KJJG_3)){
					 
					 $ZJZS=$ZJZS+1;
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="定位胆1~5"){
		  
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(STRSTR($HMARAY[0],$KJJG_1)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($HMARAY[1],$KJJG_2)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($HMARAY[2],$KJJG_3)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($HMARAY[3],$KJJG_4)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($HMARAY[4],$KJJG_5)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
	 }
	 IF($WFNAME['class_name_mini']=="定位胆6~10"){
	 	
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	
		 IF(STRSTR($HMARAY[5],$KJJG_6)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($HMARAY[6],$KJJG_7)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($HMARAY[7],$KJJG_8)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($HMARAY[8],$KJJG_9)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($HMARAY[9],$KJJG_10)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="龙虎冠军"){
		 
		 $HMARAY=explode(" ",$OLD_TZ['tzhm']);
		 
		 FOR($P=0;$P<COUNT($HMARAY);$P++){
			 
			 IF($HMARAY[$P]=="龙" && $KJJG_1>$KJJG_10){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF($HMARAY[$P]=="虎" && $KJJG_1<$KJJG_10){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
	 }
	 IF($WFNAME['class_name_mini']=="龙虎亚军"){
		 
		 $HMARAY=explode(" ",$OLD_TZ['tzhm']);
		 
		 FOR($P=0;$P<COUNT($HMARAY);$P++){
			 
			 IF($HMARAY[$P]=="龙" && $KJJG_2>$KJJG_9){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF($HMARAY[$P]=="虎" && $KJJG_2<$KJJG_9){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
	 }
	 IF($WFNAME['class_name_mini']=="龙虎季军"){
		 
		 $HMARAY=explode(" ",$OLD_TZ['tzhm']);
		 
		 FOR($P=0;$P<COUNT($HMARAY);$P++){
			 
			 IF($HMARAY[$P]=="龙" && $KJJG_3>$KJJG_8){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF($HMARAY[$P]=="虎" && $KJJG_3<$KJJG_8){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
	 }
	 IF($WFNAME['class_name_mini']=="龙虎第四名"){
		 
		 $HMARAY=explode(" ",$OLD_TZ['tzhm']);
		 
		 FOR($P=0;$P<COUNT($HMARAY);$P++){
			 
			 IF($HMARAY[$P]=="龙" && $KJJG_4>$KJJG_7){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF($HMARAY[$P]=="虎" && $KJJG_4<$KJJG_7){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
	 }
	 IF($WFNAME['class_name_mini']=="龙虎第五名"){
		 
		 $HMARAY=explode(" ",$OLD_TZ['tzhm']);
		 
		 FOR($P=0;$P<COUNT($HMARAY);$P++){
			 
			 IF($HMARAY[$P]=="龙" && $KJJG_5>$KJJG_6){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF($HMARAY[$P]=="虎" && $KJJG_5<$KJJG_6){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
	 }
	 IF($WFNAME['class_name_mini']=="大小单双冠亚和"){
		 
		 $HMARAY=explode(" ",$OLD_TZ['tzhm']);
		 
		 $GYHEZHI=$KJJG_1+$KJJG_2;
		 
		 FOR($P=0;$P<COUNT($HMARAY);$P++){
			 
			 IF($HMARAY[$P]=="大" && $GYHEZHI>11){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF($HMARAY[$P]=="小" && $GYHEZHI<11){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF($HMARAY[$P]=="单" && $GYHEZHI!=11 && $GYHEZHI%2!=0){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF($HMARAY[$P]=="双" && $GYHEZHI!=11 && $GYHEZHI%2==0){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
	 }
	 if($WFNAME['class_name_mini'] == "五行冠军"){
	 	
	 	if($KJJG_1=='1' || $KJJG_1 == '2'){
	 		if(strstr($OLD_TZ['tzhm'], '金') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_1=='3' || $KJJG_1 == '4'){
	 		if(strstr($OLD_TZ['tzhm'], '木') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_1=='5' || $KJJG_1 == '6'){
	 		if(strstr($OLD_TZ['tzhm'], '水') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_1=='7' || $KJJG_1 == '8'){
	 		if(strstr($OLD_TZ['tzhm'], '火') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_1=='9' || $KJJG_1 == '10'){
	 		if(strstr($OLD_TZ['tzhm'], '土') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	
	 }
	 if($WFNAME['class_name_mini'] == "五行亚军"){
	 	 
	 	if($KJJG_2=='1' || $KJJG_2 == '2'){
	 		if(strstr($OLD_TZ['tzhm'], '金') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_2=='3' || $KJJG_2 == '4'){
	 		if(strstr($OLD_TZ['tzhm'], '木') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_2=='5' || $KJJG_2 == '6'){
	 		if(strstr($OLD_TZ['tzhm'], '水') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_2=='7' || $KJJG_2 == '8'){
	 		if(strstr($OLD_TZ['tzhm'], '火') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_2=='9' || $KJJG_2 == '10'){
	 		if(strstr($OLD_TZ['tzhm'], '土') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	 
	 }
	 if($WFNAME['class_name_mini'] == "五行季军"){
	 	 
	 	if($KJJG_3=='1' || $KJJG_3 == '2'){
	 		if(strstr($OLD_TZ['tzhm'], '金') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_3=='3' || $KJJG_3 == '4'){
	 		if(strstr($OLD_TZ['tzhm'], '木') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_3=='5' || $KJJG_3 == '6'){
	 		if(strstr($OLD_TZ['tzhm'], '水') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_3=='7' || $KJJG_3 == '8'){
	 		if(strstr($OLD_TZ['tzhm'], '火') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	if($KJJG_3=='9' || $KJJG_3 == '10'){
	 		if(strstr($OLD_TZ['tzhm'], '土') !== false){
	 			$ZJZS += 1;
	 		}
	 	}
	 	 
	 }
	 if($WFNAME['class_name_mini'] =="冠亚和和值"){
		 if($OLD_TZ['tzhm'] == '3'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '4'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '5'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '6'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '7'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '8'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '9'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '10'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '11'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '12'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '13'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '14'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '15'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '16'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '17'){
		     if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '18'){
		 	if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
		 if($OLD_TZ['tzhm'] == '19'){
		 	if($OLD_TZ['tzhm'] == ($KJJG_1+$KJJG_2)) $ZJZS += 1;
		 }
	 }

	 IF($WFNAME['class_name_mini']=="冠军大小"){
	     if($KJJG_1 > 5) {
	         $sign_1 = '大';
	     } else {
	         $sign_1 = '小';
	     }
	     $HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_1);
	     if($HMARAY !== false) $ZJZS = 1;
	     $HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_1);
	     if($HMARAY !== false) $ZJZS = 1;

	 }
	 IF($WFNAME['class_name_mini']=="冠军单双"){
	 	if(($KJJG_1%2) == 0) {
	 		$sign_2 = '双';
	 	} else {
	 		$sign_2 = '单';
	 	}
	 	$HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_2);
	 	if($HMARAY !== false) $ZJZS = 1;
	 	$HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_2);
	 	if($HMARAY !== false) $ZJZS = 1;
	 }
	 IF($WFNAME['wanfa']=="亚军大小"){
	     if($KJJG_2 > 5) {
	         $sign_1 = '大';
	     } else {
	         $sign_1 = '小';
	     }
	     $HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_1);
	     if($HMARAY !== false) $ZJZS = 1;
	     $HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_1);
	     if($HMARAY !== false) $ZJZS = 1;

	 }
	 IF($WFNAME['wanfa']=="亚军单双"){
	 	if(($KJJG_2%2) == 0) {
	 		$sign_2 = '双';
	 	} else {
	 		$sign_2 = '单';
	 	}

	 	$HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_2);
	 	if($HMARAY !== false) $ZJZS = 1;
	 	$HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_2);
	 	if($HMARAY !== false) $ZJZS = 1;
	 }
	 IF($WFNAME['wanfa']=="季军大小"){
	     if($KJJG_3 > 5) {
	         $sign_1 = '大';
	     } else {
	         $sign_1 = '小';
	     }
	     $HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_1);
	     if($HMARAY !== false) $ZJZS = 1;
	     $HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_1);
	     if($HMARAY !== false) $ZJZS = 1;
	 }
	 IF($WFNAME['wanfa']=="季军单双"){
	 	if(($KJJG_3%2) == 0) {
	 		$sign_2 = '双';
	 	} else {
	 		$sign_2 = '单';
	 	}
	 	$HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_2);
	 	if($HMARAY !== false) $ZJZS = 1;
	 	$HMARAY=mb_strpos($OLD_TZ['tzhm'],$sign_2);
	 	if($HMARAY !== false) $ZJZS = 1;
	 }
	 
	 
	 //结算中奖金额并且删除投注数据表转移到已结算表
	 
	 //定义试玩账号和内部账号  区分写入表
	 
	 $USER_CL=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='".$OLD_TZ['username']."'")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($USER_CL['nbzh']==1 || $USER_CL['swzh']==1){
		 
		 $MYSQL_NAME="kkty_touzhu_list_sw";
		 
	 }ELSE{
		 
		 $MYSQL_NAME="kkty_touzhu_list_ok";
		 
	 }
	 
	 //取出中奖金额
	 
	 IF($OLD_TZ['nbzh']==1){$TZMS_LH=1;}
	 
	 IF($OLD_TZ['nbzh']==2){$TZMS_LH=10;}
	 
	 IF($OLD_TZ['nbzh']==3){$TZMS_LH=100;}
	 
	 //中奖金额算法注释   投注赔率 除以2 乘以单注金额 乘以 中奖注数 除以 投注模式 （赔率*单注金额*中奖注数/投注模式）
	 
	 $ZJJE=$OLD_TZ['dqpl']*$OLD_TZ['dzje']*$ZJZS/$TZMS_LH;
	
	 //转移投注注单
	 
	 $MYSQL_ZHIXING_YUJU_A="`id`,`czid`,`qihao`,`tzhm`,`tzje`,`dzje`,`tzzs`,`username`,`tzhje`,`zjje`,`ifqs`,`wfid`,`dqpl`,`xzfd`,`fdje`,`kjjg`,`zjzs`,`nbzh`,`tz_time`";
	  
	 $MYSQL_ZHIXING_YUJU_B="'".$OLD_TZ['id']."','".$OLD_TZ['czid']."','".$OLD_TZ['qihao']."','".$OLD_TZ['tzhm']."','".$OLD_TZ['tzje']."','".$OLD_TZ['dzje']."','".$OLD_TZ['tzzs']."','".$OLD_TZ['username']."','".$OLD_TZ['tzhje']."','{$ZJJE}','1','".$OLD_TZ['wfid']."','".$OLD_TZ['dqpl']."','".$OLD_TZ['xzfd']."','".$OLD_TZ['fdje']."','{$KJJG}','{$ZJZS}','".$OLD_TZ['nbzh']."','".$OLD_TZ['tz_time']."'";
	
	 try{ 
		$db_pdo_link->beginTransaction(); 
		$db_pdo_link->exec("INSERT INTO `{$MYSQL_NAME}` ($MYSQL_ZHIXING_YUJU_A) VALUES ($MYSQL_ZHIXING_YUJU_B)");
	 
		$db_pdo_link->exec("DELETE FROM `kkty_touzhu_list_no` WHERE id={$TZID}");
		 
		//判断中奖金额大于0.001 大于的话给用户增加金额
		 
		IF($ZJJE>0.001)
		{
			 
			$db_pdo_link->exec("UPDATE kkty_username SET `je`=`je` + '{$ZJJE}',`zjzje`=`zjzje`+'{$ZJJE}' WHERE id={$USER_CL['id']}");	
		}
		//发送消息
		$CZNMSD=$db_pdo_link->query("SELECT * FROM kkty_caipai_list WHERE id={$OLD_TZ['czid']}")->fetch(PDO::FETCH_ASSOC);
		 
		IF($CZNMSD['cp_name_new']==""){$CZNMSD['cp_name_new']=$CZNMSD['cp_name_old'];}
		 
		USER_FASONG($USER_CL['username'],"您投注的彩种：【{$CZNMSD['cp_name_new']}】第：【{$OLD_TZ['qihao']}】已开奖，中奖金额：【{$ZJJE}】元！");
		
		$db_pdo_link->commit(); 
		return true;
		
	 }catch(PDOException $e)
	 {
		$db_pdo_link->rollBack();
		return false;
	 } 
	 
	 
}
//---------------------------------------北京赛车---------------------------------------------------------

//建立PC蛋蛋投注注单结算公共类

//---------------------------------------------------pc蛋蛋的---------------------------------------------------//

FUNCTION PCDD_TOUZHUJIESUAN($TZID,$KJJG){
	 
	 GLOBAL $db_pdo_link;
	 
	 $OLD_TZ=$db_pdo_link->query("SELECT * FROM kkty_touzhu_list_no WHERE id={$TZID}")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($OLD_TZ['wfid']>0){
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_play_classify WHERE id={$OLD_TZ['wfid']}")->fetch(PDO::FETCH_ASSOC);
		 
	 }ELSE{
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_peilv WHERE wanfa='".$OLD_TZ['tzhm']."'")->fetch(PDO::FETCH_ASSOC);
		 
	 }
	 
	 $KJJG_1=SUBSTR($KJJG,0,1);
	 
	 $KJJG_2=SUBSTR($KJJG,1,1);
	 
	 $KJJG_3=SUBSTR($KJJG,2,1);
	 
	 $KJJG_HE=FLOOR($KJJG_1+$KJJG_2+$KJJG_3);
	 
	 $ZJZS=0;
	 
	 $ZJJE=0;
	 
	 if($WFNAME['class_name_mini']=="PC蛋蛋"){

	 	IF($OLD_TZ['tzhm']=="大" && $KJJG_HE>13){	
	 	
	 			$ZJZS=$ZJZS+1;
	 	}
	 	IF($OLD_TZ['tzhm']=="小" && $KJJG_HE<14){
	 	
	 			$ZJZS=$ZJZS+1;	
	 	}
	 	IF($OLD_TZ['tzhm']=="单" && $KJJG_HE%2!=0){
	 		
	 			$ZJZS=$ZJZS+1;
	 	}
	 	IF($OLD_TZ['tzhm']=="双" && $KJJG_HE%2==0){

	 			$ZJZS=$ZJZS+1;	
	 	}
	 	IF($OLD_TZ['tzhm']=="红波"){
	 		IF($KJJG_HE==3 || $KJJG_HE==6 || $KJJG_HE==9 || $KJJG_HE==12 || $KJJG_HE==15 || $KJJG_HE==18 || $KJJG_HE==21 || $KJJG_HE==24){
	 	
	 			$ZJZS=$ZJZS+1;
	 	
	 		}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="蓝波"){
	 		IF($KJJG_HE==2 || $KJJG_HE==5 || $KJJG_HE==8 || $KJJG_HE==11 || $KJJG_HE==17 || $KJJG_HE==20 || $KJJG_HE==23 || $KJJG_HE==26){
	 	
	 			$ZJZS=$ZJZS+1;
	 	
	 		}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="绿波"){
	 		IF($KJJG_HE==1 || $KJJG_HE==4 || $KJJG_HE==7 || $KJJG_HE==10 || $KJJG_HE==16 || $KJJG_HE==19 || $KJJG_HE==22 || $KJJG_HE==25){
	 	
	 			$ZJZS=$ZJZS+1;
	 	
	 		}
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="大单" && $KJJG_HE>13 && $KJJG_HE%2!=0){

	 			$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="大双" && $KJJG_HE>13 && $KJJG_HE%2==0){
	
	 			$ZJZS=$ZJZS+1;
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="小单" && $KJJG_HE<14 && $KJJG_HE%2!=0){

	 			$ZJZS=$ZJZS+1;
	 			
	 	}
	 	IF($OLD_TZ['tzhm']=="小双" && $KJJG_HE<14 && $KJJG_HE%2==0){

	 			$ZJZS=$ZJZS+1;
	 	}
	 	IF($OLD_TZ['tzhm']=="极大" && $KJJG_HE>21){

	 			$ZJZS=$ZJZS+1;	
	 	}
	 	IF($OLD_TZ['tzhm']=="极小" && $KJJG_HE<6){

	 			$ZJZS=$ZJZS+1;
	 		
	 	}
	 	IF($OLD_TZ['tzhm']=="0" && $KJJG_HE==0){

	 			$ZJZS=$ZJZS+1;
	
	 	}
	 	IF($OLD_TZ['tzhm']=="1" && $KJJG_HE==1){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="2" && $KJJG_HE==2){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="3" && $KJJG_HE==3){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="4" && $KJJG_HE==4){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="5" && $KJJG_HE==5){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="6" && $KJJG_HE==6){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="7" && $KJJG_HE==7){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="8" && $KJJG_HE==8){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="9" && $KJJG_HE==9){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="10" && $KJJG_HE==10){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="11" && $KJJG_HE==11){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="12" && $KJJG_HE==12){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="13" && $KJJG_HE==13){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="14" && $KJJG_HE==14){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="15" && $KJJG_HE==15){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="16" && $KJJG_HE==16){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="17" && $KJJG_HE==17){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="18" && $KJJG_HE==18){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="19" && $KJJG_HE==19){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="20" && $KJJG_HE==20){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="21" && $KJJG_HE=21){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="22" && $KJJG_HE==22){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="23" && $KJJG_HE==23){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="24" && $KJJG_HE==24){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="25" && $KJJG_HE==25){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="26" && $KJJG_HE==26){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	IF($OLD_TZ['tzhm']=="27" && $KJJG_HE==27){
	 	
	 		$ZJZS=$ZJZS+1;
	 	
	 	}
	 	
	 }
	 
	 
	 
	 //结算中奖金额并且删除投注数据表转移到已结算表
	 
	 //定义试玩账号和内部账号  区分写入表
	 
	 $USER_CL=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='".$OLD_TZ['username']."'")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($USER_CL['nbzh']==1 || $USER_CL['swzh']==1){
		 
		 $MYSQL_NAME="kkty_touzhu_list_sw";
		 
	 }ELSE{
		 
		 $MYSQL_NAME="kkty_touzhu_list_ok";
		 
	 }
	 
	 //取出中奖金额
	 
	 IF($OLD_TZ['nbzh']==1){$TZMS_LH=1;}
	 
	 IF($OLD_TZ['nbzh']==2){$TZMS_LH=10;}
	 
	 IF($OLD_TZ['nbzh']==3){$TZMS_LH=100;}
	 
	 //中奖金额算法注释   投注赔率 除以2 乘以单注金额 乘以 中奖注数 除以 投注模式 （赔率*单注金额*中奖注数/投注模式）
	 
	 $ZJJE=$OLD_TZ['dqpl']*$OLD_TZ['dzje']*$ZJZS/$TZMS_LH;
	
	 //转移投注注单
	 
	 $MYSQL_ZHIXING_YUJU_A="`id`,`czid`,`qihao`,`tzhm`,`tzje`,`dzje`,`tzzs`,`username`,`tzhje`,`zjje`,`ifqs`,`wfid`,`dqpl`,`xzfd`,`fdje`,`kjjg`,`zjzs`,`nbzh`,`tz_time`";
	 
	 $MYSQL_ZHIXING_YUJU_B="'".$OLD_TZ['id']."','".$OLD_TZ['czid']."','".$OLD_TZ['qihao']."','".$OLD_TZ['tzhm']."','".$OLD_TZ['tzje']."','".$OLD_TZ['dzje']."','".$OLD_TZ['tzzs']."','".$OLD_TZ['username']."','".$OLD_TZ['tzhje']."','{$ZJJE}','1','".$OLD_TZ['wfid']."','".$OLD_TZ['dqpl']."','".$OLD_TZ['xzfd']."','".$OLD_TZ['fdje']."','{$KJJG}','{$ZJZS}','".$OLD_TZ['nbzh']."','".$OLD_TZ['tz_time']."'";
	 
	 try{ 
		$db_pdo_link->beginTransaction(); 
		$db_pdo_link->exec("INSERT INTO `{$MYSQL_NAME}` ($MYSQL_ZHIXING_YUJU_A) VALUES ($MYSQL_ZHIXING_YUJU_B)");
	 
		$db_pdo_link->exec("DELETE FROM `kkty_touzhu_list_no` WHERE id={$TZID}");
		 
		//判断中奖金额大于0.001 大于的话给用户增加金额
		 
		IF($ZJJE>0.001)
		{
			 
			$db_pdo_link->exec("UPDATE kkty_username SET `je`=`je` + '{$ZJJE}',`zjzje`=`zjzje`+'{$ZJJE}' WHERE id={$USER_CL['id']}");	
		}
		//发送消息
		$CZNMSD=$db_pdo_link->query("SELECT * FROM kkty_caipai_list WHERE id={$OLD_TZ['czid']}")->fetch(PDO::FETCH_ASSOC);
		 
		IF($CZNMSD['cp_name_new']==""){$CZNMSD['cp_name_new']=$CZNMSD['cp_name_old'];}
		 
		USER_FASONG($USER_CL['username'],"您投注的彩种：【{$CZNMSD['cp_name_new']}】第：【{$OLD_TZ['qihao']}】已开奖，中奖金额：【{$ZJJE}】元！");
		
		$db_pdo_link->commit(); 
		return true;
		
	 }catch(PDOException $e)
	 {
		$db_pdo_link->rollBack();
		return false;
	 } 
	 
}
//---------------------------------------------------pc蛋蛋的---------------------------------------------------//


//建立11选5投注注单结算公共类【广东,山东,江西】

//---------------------------------------------------11选5的[玩法已和前台比对]-----------------------------------//

FUNCTION SHIYIXUANWU_TOUZHUJIESUAN($TZID,$KJJG){
	 
	 GLOBAL $db_pdo_link;
	 
	 $OLD_TZ=$db_pdo_link->query("SELECT * FROM kkty_touzhu_list_no WHERE id={$TZID}")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($OLD_TZ['wfid']>0){
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_play_classify where id={$OLD_TZ['wfid']}")->fetch(PDO::FETCH_ASSOC);
		 
	 }ELSE{
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_peilv WHERE wanfa='".$OLD_TZ['tzhm']."'")->fetch(PDO::FETCH_ASSOC);
		 
	 }
	 
	 $KJJG_1=SUBSTR($KJJG,0,2);
	 
	 $KJJG_2=SUBSTR($KJJG,2,2);
	 
	 $KJJG_3=SUBSTR($KJJG,4,2);
	 
	 $KJJG_4=SUBSTR($KJJG,6,2);
	 
	 $KJJG_5=SUBSTR($KJJG,8,2);
	 
	 $KJJG_H = $KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
	 
	 $ZJZS=0;
	 
	 $ZJJE=0;
	 
	 IF($WFNAME['class_name_mini']=="前三直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==3){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1)){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2)){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_3)){
					 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }

	 
	 IF($WFNAME['class_name_mini']=="前三组选复式"){
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
		 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){
					 
					 $ZJZS=$ZJZS+1;
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="前二直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==2){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1)){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2)){
				 
					 $ZJZS=$ZJZS+1;
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 
	 IF($WFNAME['class_name_mini']=="前二组选复式"){
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
		 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){
			 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
		 
	 }

	 IF($WFNAME['class_name_mini']=="不定胆前三位"){
	 	
	 	$OLD = explode(' ', $OLD_TZ['tzhm']);
		 
	 	for($i=0;$i<count($OLD);$i++){
	 		
			 IF(STRSTR($OLD[$i],$KJJG_1) || STRSTR($OLD_TZ['tzhm'],$KJJG_2) || STRSTR($OLD_TZ['tzhm'],$KJJG_3)){
				 
				 $ZJZS+=1;
			 
			 }
	 	}
		
	 }

	 IF($WFNAME['class_name_mini']=="定位胆"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==5){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1)){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF(STRSTR($HMARAY[1],$KJJG_2)){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF(STRSTR($HMARAY[2],$KJJG_3)){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF(STRSTR($HMARAY[3],$KJJG_4)){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 IF(STRSTR($HMARAY[4],$KJJG_5)){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="任选复式一中一"){
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		
	 }
	 IF($WFNAME['class_name_mini']=="任选复式二中二"){
		 
		 $KJHM_CX=0;
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 
		 IF($KJHM_CX==2){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 
		 IF($KJHM_CX==3){
			 
			 $ZJZS=$ZJZS+3;
			 
		 }
		 IF($KJHM_CX==4){
			 
			 $ZJZS=$ZJZS+6;
			 
		 }
		 IF($KJHM_CX==5){
			 
			 $ZJZS=$ZJZS+10;
			 
		 }
		
	 }
	 IF($WFNAME['class_name_mini']=="任选复式三中三"){
		 
		 $KJHM_CX=0;
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 
		 IF($KJHM_CX==3){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 
		 IF($KJHM_CX==4){
			 
			 $ZJZS=$ZJZS+4;
			 
		 }
		 IF($KJHM_CX==5){
			 
			 $ZJZS=$ZJZS+10;
			 
		 }
		
	 }
	 IF($WFNAME['class_name_mini']=="任选复式四中四"){
		 
		 $KJHM_CX=0;
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){
			 
			 $KJHM_CX=$KJHM_CX+1;
			 
		 }
		 
		 IF($KJHM_CX==4){
			 
			 $ZJZS=$ZJZS+1;
			 
		 }
		 
		 IF($KJHM_CX==5){
			 
			 $ZJZS=$ZJZS+10;
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="任选复式五中五"){
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){
						 
						 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){
							 
							 $ZJZS=$ZJZS+1;
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 
	 IF($WFNAME['class_name_mini']=="任选复式六中五"){
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){
						 
						 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){
							 
							 $LINUS=1;
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
		 IF($LINUS==1){
			 
			 $HMTHXX=str_replace(" ","",$OLD_TZ['tzhm']);
			 
			 $HMCDS=STRLEN($HMTHXX)/2;
			 
			 $CHANGDU_TZ=$HMCDS-5;
			 
			 $ZJZS=$ZJZS+$CHANGDU_TZ;
			 
		 }
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="任选复式七中五"){
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){
						 
						 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){
							 
							 $LINUS=1;
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
		 IF($LINUS==1){
			 
			 $HMTHXX=str_replace(" ","",$OLD_TZ['tzhm']);
			 
			 $HMCDS=STRLEN($HMTHXX)/2;
			 
			 $CHANGDU_TZ=($HMCDS-5)*($HMCDS-6)/2;
			 
			 $ZJZS=$ZJZS+$CHANGDU_TZ;
			 
		 }
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="任选复式八中五"){
		 
		 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4)){
						 
						 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5)){
							 
							 $LINUS=1;
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
		 IF($LINUS==1){
			 
			 $HMTHXX=str_replace(" ","",$OLD_TZ['tzhm']);
			 
			 $HMCDS=STRLEN($HMTHXX)/2;
			 
			 $CHANGDU_TZ=($HMCDS-5)*($HMCDS-6)*($HMCDS-7)/6;
			 
			 $ZJZS=$ZJZS+$CHANGDU_TZ;
			 
		 }
		 
	 }

	 //结算中奖金额并且删除投注数据表转移到已结算表
	 
	 //定义试玩账号和内部账号  区分写入表
	 
	 $USER_CL=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='".$OLD_TZ['username']."'")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($USER_CL['nbzh']==1 || $USER_CL['swzh']==1){
		 
		 $MYSQL_NAME="kkty_touzhu_list_sw";
		 
	 }ELSE{
		 
		 $MYSQL_NAME="kkty_touzhu_list_ok";
		 
	 }
	 
	 //取出中奖金额
	 
	 IF($OLD_TZ['nbzh']==1){$TZMS_LH=1;}
	 
	 IF($OLD_TZ['nbzh']==2){$TZMS_LH=10;}
	 
	 IF($OLD_TZ['nbzh']==3){$TZMS_LH=100;}
	 
	 //中奖金额算法注释   投注赔率 除以2 乘以单注金额 乘以 中奖注数 除以 投注模式 （赔率*单注金额*中奖注数/投注模式）
	 
	 
	 $ZJJE=$OLD_TZ['dqpl']*$OLD_TZ['dzje']*$ZJZS/$TZMS_LH;

	 //转移投注注单
	 
	 $MYSQL_ZHIXING_YUJU_A="`id`,`czid`,`qihao`,`tzhm`,`tzje`,`dzje`,`tzzs`,`username`,`tzhje`,`zjje`,`ifqs`,`wfid`,`dqpl`,`xzfd`,`fdje`,`kjjg`,`zjzs`,`nbzh`,`tz_time`";
	 
	 $MYSQL_ZHIXING_YUJU_B="'".$OLD_TZ['id']."','".$OLD_TZ['czid']."','".$OLD_TZ['qihao']."','".$OLD_TZ['tzhm']."','".$OLD_TZ['tzje']."','".$OLD_TZ['dzje']."','".$OLD_TZ['tzzs']."','".$OLD_TZ['username']."','".$OLD_TZ['tzhje']."','{$ZJJE}','1','".$OLD_TZ['wfid']."','".$OLD_TZ['dqpl']."','".$OLD_TZ['xzfd']."','".$OLD_TZ['fdje']."','{$KJJG}','{$ZJZS}','".$OLD_TZ['nbzh']."','".$OLD_TZ['tz_time']."'";
	 
	  try{ 
		$db_pdo_link->beginTransaction(); 
		$db_pdo_link->exec("INSERT INTO `{$MYSQL_NAME}` ($MYSQL_ZHIXING_YUJU_A) VALUES ($MYSQL_ZHIXING_YUJU_B)");
	 
		$db_pdo_link->exec("DELETE FROM `kkty_touzhu_list_no` WHERE id={$TZID}");
		 
		//判断中奖金额大于0.001 大于的话给用户增加金额
		 
		IF($ZJJE>0.001)
		{
			 
			$db_pdo_link->exec("UPDATE kkty_username SET `je`=`je` + '{$ZJJE}',`zjzje`=`zjzje`+'{$ZJJE}' WHERE id={$USER_CL['id']}");	
		}
		//发送消息
		$CZNMSD=$db_pdo_link->query("SELECT * FROM kkty_caipai_list WHERE id={$OLD_TZ['czid']}")->fetch(PDO::FETCH_ASSOC);
		 
		IF($CZNMSD['cp_name_new']==""){$CZNMSD['cp_name_new']=$CZNMSD['cp_name_old'];}
		 
		USER_FASONG($USER_CL['username'],"您投注的彩种：【{$CZNMSD['cp_name_new']}】第：【{$OLD_TZ['qihao']}】已开奖，中奖金额：【{$ZJJE}】元！");
		
		$db_pdo_link->commit(); 
		return true;
		
	 }catch(PDOException $e)
	 {
		$db_pdo_link->rollBack();
		return false;
	 } 
}

function zm_calculate_11_5($value,$KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4) {
    $tzhm = explode('_',$value);
    $tzhm[0] = substr($tzhm[0],-3);
    $tzhm[0] = str_replace(array('一','二','三','四'),array('1','2','3','4'),$tzhm[0]);
    $res = 'KJJG_'.$tzhm[0];
    return $$res;
}
//---------------------------------------------------11选5的---------------------------------------------------//



//建立快三投注注单结算公共类 [玩法已和前台比对]

//-------------------------------------------快3彩种类结算----------------------------------------------------------//

FUNCTION KUAISAN_TOUZHUJIESUAN($TZID,$KJJG){
	 
	 GLOBAL $db_pdo_link;
	 
	 $OLD_TZ=$db_pdo_link->query("SELECT * FROM kkty_touzhu_list_no WHERE id={$TZID}")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($OLD_TZ['wfid']>0){
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_play_classify where id={$OLD_TZ['wfid']}")->fetch(PDO::FETCH_ASSOC);
		 
	 }ELSE{
		 
		 $WFNAME=$db_pdo_link->query("SELECT * FROM kkty_peilv WHERE wanfa='".$OLD_TZ['tzhm']."'")->fetch(PDO::FETCH_ASSOC);
		 
	 }
	 
	 $KJJG_1=SUBSTR($KJJG,0,1);
	 
	 $KJJG_2=SUBSTR($KJJG,1,1);
	 
	 $KJJG_3=SUBSTR($KJJG,2,1);
	 
	 $ZJZS=0;
	 
	 $ZJJE=0;
	 
	 IF($WFNAME['class_name_mini']=="和值" ){
		 
		 $HEZHI_KS=FLOOR($KJJG_1+$KJJG_2+$KJJG_3);

		 $DUIBI=FLOOR($OLD_TZ['tzhm']);
		 
		 IF($HEZHI_KS==$DUIBI){$ZJZS=$ZJZS+1;}
		 IF($OLD_TZ['tzhm']=="小"){
		 	if($HEZHI_KS>2 && $HEZHI_KS<11){
		 		$ZJZS=$ZJZS+1;
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="大"){
		 	if($HEZHI_KS>10 && $HEZHI_KS<18){
		 		$ZJZS=$ZJZS+1;
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="单"){
		 	if($HEZHI_KS%2==1){
		 		$ZJZS=$ZJZS+1;
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="双"){
		 	if($HEZHI_KS%2==0){
		 		$ZJZS=$ZJZS+1;
		 	}
		 }
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="三同号通选"){
		 
		 IF($OLD_TZ['tzhm']=="通选" && $KJJG_1==$KJJG_2 && $KJJG_1==$KJJG_3 && $KJJG_2==$KJJG_3){$ZJZS=$ZJZS+1;}
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="三同号单选"){
		 
		 IF($KJJG_1==$KJJG_2 && $KJJG_1==$KJJG_3 && $KJJG_2==$KJJG_3){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG)){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
		 
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="三不同号标准"){
		 
		 IF($KJJG_1!=$KJJG_2 && $KJJG_1!=$KJJG_3 && $KJJG_2!=$KJJG_3){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1)){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2)){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3)){
						 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
			 
		 }
		 
		 
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="三不同号胆拖"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==2){
			 
			 $HMARAY[0]=str_replace(" ","",$HMARAY[0]);
			 
			 $HMARAY[1]=str_replace(" ","",$HMARAY[1]);
			 
			 FOR($K_1=0;$K_1<STRLEN($HMARAY[0]);$K_1++){
				 
				 FOR($K_2=0;$K_2<STRLEN($HMARAY[1]);$K_2++){
					 
					 FOR($K_3=0;$K_3<STRLEN($HMARAY[1]);$K_3++){
						 
						 $UH_1=SUBSTR($HMARAY[0],$K_1,1);
						 
						 $UH_2=SUBSTR($HMARAY[1],$K_2,1);
						 
						 $UH_3=SUBSTR($HMARAY[1],$K_3,1);
						 
						 IF($UH_1!=$UH_2 && $UH_1!=$UH_3 && $UH_2!=$UH_3){
							 
							 IF($KJJG_1!=$KJJG_2 && $KJJG_1!=$KJJG_3 && $KJJG_2!=$KJJG_3){
								 
								 $ZHQILAIHM=$UH_1.$UH_2.$UH_3;
								 
								 IF($KJJG==$ZHQILAIHM){$ZJZS=$ZJZS+1;}
								 
							 }
							 	
						 }
						 
						 
					 }
					 
				 }
				 
			 }
			 
			 
		 }
		 
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="三连号通选"){
		 
		 IF($OLD_TZ['tzhm']=="通选"){
			 
			 IF($KJJG=="123" || $KJJG=="234" || $KJJG=="345" || $KJJG=="456"){
				 
				 $ZJZS=$ZJZS+1;
				 
			 }
			 
		 }
		 
		 
		 
	 }
	 IF($WFNAME['class_name_mini']=="二同号复选"){
		 
		 $HMARCSHDU=str_replace(" ","",$OLD_TZ['tzhm']);
		 
		 FOR($K=0;$K<STRLEN($HMARCSHDU);$K++){
			 
			 IF($K%2==0){
				 
				 $CHOUCHUHM=SUBSTR($HMARCSHDU,$K,2);
				 
				 IF(STRSTR($KJJG,$CHOUCHUHM)){
					 
					 $ZJZS=$ZJZS+1;
					 
				 }
				 
				 
			 }
			 
		 }
		 
	 }
	 IF($WFNAME['class_name_mini']=="二同号单选标准"){
		 
		 $HMARCSHDU=str_replace(" ","",$OLD_TZ['tzhm']);
		 
		 $HMARAY=explode(",",$HMARCSHDU);
		 
		 IF(COUNT($HMARAY)==2){
			 
			 FOR($K=0;$K<STRLEN($HMARAY[0]);$K++){
			 
				 FOR($K_1=0;$K_1<STRLEN($HMARAY[1]);$K_1++){
					 
					 IF($K%2==0){
						 
						 $TOUZHHM=SUBSTR($HMARAY[0],$K,2).SUBSTR($HMARAY[1],$K_1,1);
						 
						 $TOUZHHM_1=SUBSTR($HMARAY[1],$K_1,1).SUBSTR($HMARAY[0],$K,2);
						 
						 IF($KJJG==$TOUZHHM || $KJJG==$TOUZHHM_1){
							 
							 $ZJZS=$ZJZS+1;
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
			 
		 }
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="二不同号标准"){
		 
		 $HMARCSHDU=str_replace(" ","",$OLD_TZ['tzhm']);
		 
		 FOR($K_1=0;$K_1<STRLEN($HMARCSHDU);$K_1++){
			 
			 FOR($K_2=0;$K_2<STRLEN($HMARCSHDU);$K_2++){
			 
				 $HMQ_1=SUBSTR($HMARCSHDU,$K_1,1);
				 
				 $HMQ_2=SUBSTR($HMARCSHDU,$K_2,1);
				 
				 IF($HMQ_1!=$HMQ_2){
					 
					 $HM_JG=$HMQ_1.$HMQ_2;
					 
					 IF(STRSTR($KJJG,$HM_JG)){
						 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
		 
	 }
	 
	 IF($WFNAME['class_name_mini']=="二不同号胆拖"){
		 
		 $HMARCSHDU=str_replace(" ","",$OLD_TZ['tzhm']);
		 
		 $HMARAY=explode(",",$HMARCSHDU);
		 
		 IF(COUNT($HMARAY)==2){
			 
			 FOR($K=0;$K<STRLEN($HMARAY[0]);$K++){
			 
				 FOR($K_1=0;$K_1<STRLEN($HMARAY[1]);$K_1++){
					 
					 $HMQ_1=SUBSTR($HMARAY[0],$K,1);
				 
					 $HMQ_2=SUBSTR($HMARAY[1],$K_1,1);
					 
					 if($HMQ_1 != $HMQ_2) {
						 if((strpos($KJJG,$HMQ_1) !== false) &&(strpos($KJJG,$HMQ_2) !== false)) {
							 $ZJZS += 1;
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 
	 //结算中奖金额并且删除投注数据表转移到已结算表
	 
	 //定义试玩账号和内部账号  区分写入表
	 
	 $USER_CL=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='$OLD_TZ[username]'")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($USER_CL['nbzh']==1 || $USER_CL['swzh']==1){
		 
		 $MYSQL_NAME="kkty_touzhu_list_sw";
		 
	 }ELSE{
		 
		 $MYSQL_NAME="kkty_touzhu_list_ok";
		 
	 }
	 
	 //取出中奖金额
	 
	 IF($OLD_TZ['nbzh']==1){$TZMS_LH=1;}
	 
	 IF($OLD_TZ['nbzh']==2){$TZMS_LH=10;}
	 
	 IF($OLD_TZ['nbzh']==3){$TZMS_LH=100;}
	 
	 //中奖金额算法注释   投注赔率 除以2 乘以单注金额 乘以 中奖注数 除以 投注模式 （赔率*单注金额*中奖注数/投注模式）
	 
	 $ZJJE=$OLD_TZ['dqpl']*$OLD_TZ['dzje']*$ZJZS/$TZMS_LH;
	
	 //转移投注注单
	 
	 $MYSQL_ZHIXING_YUJU_A="`id`,`czid`,`qihao`,`tzhm`,`tzje`,`dzje`,`tzzs`,`username`,`tzhje`,`zjje`,`ifqs`,`wfid`,`dqpl`,`xzfd`,`fdje`,`kjjg`,`zjzs`,`nbzh`,`tz_time`";
	 
	 $MYSQL_ZHIXING_YUJU_B="'".$OLD_TZ['id']."','".$OLD_TZ['czid']."','".$OLD_TZ['qihao']."','".$OLD_TZ['tzhm']."','".$OLD_TZ['tzje']."','".$OLD_TZ['dzje']."','".$OLD_TZ['tzzs']."','".$OLD_TZ['username']."','".$OLD_TZ['tzhje']."','{$ZJJE}','1','".$OLD_TZ['wfid']."','".$OLD_TZ['dqpl']."','".$OLD_TZ['xzfd']."','".$OLD_TZ['fdje']."','{$KJJG}','{$ZJZS}','".$OLD_TZ['nbzh']."','".$OLD_TZ['tz_time']."'";
	 try{ 
		$db_pdo_link->beginTransaction(); 
		$db_pdo_link->exec("INSERT INTO `{$MYSQL_NAME}` ($MYSQL_ZHIXING_YUJU_A) VALUES ($MYSQL_ZHIXING_YUJU_B)");
	 
		$db_pdo_link->exec("DELETE FROM `kkty_touzhu_list_no` WHERE id={$TZID}");
		 
		//判断中奖金额大于0.001 大于的话给用户增加金额
		 
		IF($ZJJE>0.001)
		{
			 
			$db_pdo_link->exec("UPDATE kkty_username SET `je`=`je` + '{$ZJJE}',`zjzje`=`zjzje`+'{$ZJJE}' WHERE id={$USER_CL['id']}");	
		}
		//发送消息
		$CZNMSD=$db_pdo_link->query("SELECT * FROM kkty_caipai_list WHERE id={$OLD_TZ['czid']}")->fetch(PDO::FETCH_ASSOC);
		 
		IF($CZNMSD['cp_name_new']==""){$CZNMSD['cp_name_new']=$CZNMSD['cp_name_old'];}
		 
		USER_FASONG($USER_CL['username'],"您投注的彩种：【{$CZNMSD['cp_name_new']}】第：【{$OLD_TZ['qihao']}】已开奖，中奖金额：【{$ZJJE}】元！");
		
		$db_pdo_link->commit(); 
		return true;
		
	 }catch(PDOException $e)
	 {
		$db_pdo_link->rollBack();
		return false;
	 } 
}

//-------------------------------------------快3彩种类结算----------------------------------------------------------//


// 建立时时彩投注注单结算公共类 【已和前台玩法对比 无问题】

//-------------------------------------------时时彩彩种类结算----------------------------------------------------------//

FUNCTION SSC_TOUZHUJIESUAN($TZID,$KJJG){
	 
	 GLOBAL $db_pdo_link;
	 
	 $OLD_TZ=$db_pdo_link->query("SELECT * FROM kkty_touzhu_list_no WHERE id={$TZID}")->fetch(PDO::FETCH_ASSOC);

	 IF($OLD_TZ['wfid']>0){
		 
		 $wanfaname = $db_pdo_link->query("SELECT * FROM kkty_play_classify where id={$OLD_TZ['wfid']}")->fetch(PDO::FETCH_ASSOC);

	 }ELSE{
		 
		 $wanfaname=$db_pdo_link->query("SELECT * FROM kkty_peilv WHERE wanfa='".$OLD_TZ['tzhm']."'")->fetch(PDO::FETCH_ASSOC);
		 
	 }
	 
	 $KJJG_1=SUBSTR($KJJG,0,1);
	 
	 $KJJG_2=SUBSTR($KJJG,1,1);
	 
	 $KJJG_3=SUBSTR($KJJG,2,1);
	 
	 $KJJG_4=SUBSTR($KJJG,3,1);
	 
	 $KJJG_5=SUBSTR($KJJG,4,1);
	 
	 $ZJZS=0;
	 
	 $ZJJE=0;

	 IF($wanfaname['class_name_mini']=="五星直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==5){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
						 
						 IF(STRSTR($HMARAY[3],$KJJG_4) !== false){
							 
							 IF(STRSTR($HMARAY[4],$KJJG_5) !== false){
								 
								 $ZJZS=$ZJZS+1;
								 
							 }
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 if($wanfaname['class_name_mini']=="五星直选组合"){
	 	
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	
	 	if(strstr($HMARAY[4], $KJJG_5) !== false){
	 		$ZJZS=$ZJZS+1;
	 		if(strstr($HMARAY[3], $KJJG_4) !== false){
	 			$ZJZS=$ZJZS+1;
	 			if(strstr($HMARAY[2], $KJJG_3) !== false){
	 				$ZJZS=$ZJZS+1;
	 				if(strstr($HMARAY[1], $KJJG_2) !== false){
	 					$ZJZS=$ZJZS+1;
	 					if(strstr($HMARAY[0], $KJJG_1) !== false){
	 						$ZJZS=$ZJZS+1;
	 					}
	 				}
	 			}
	 		}
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "五星组选120"){
	 	
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	
	 	$arr_count = array_count_values($HMARAY);
	 	
	 	rsort($arr_count);
	 	
	 	if($arr_count[0]<=1){
	 		
	 		if(strstr($OLD_TZ['tzhm'], $KJJG_1) !== false){
	 			
	 			if(strstr($OLD_TZ['tzhm'], $KJJG_2) !== false){
	 				
	 				if(strstr($OLD_TZ['tzhm'], $KJJG_3) !== false){
	 					
	 					if(strstr($OLD_TZ['tzhm'], $KJJG_4) !== false){
	 						
	 						if(strstr($OLD_TZ['tzhm'], $KJJG_5) !== false){
	 							
	 							$ZJZS = $ZJZS+1;
	 						}
	 					}
	 				}
	 			}
	 		}
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "五星组选60"){
	 	 
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	
	 	$HMARAY_A = explode(' ', $HMARAY[0]);
	 	
	 	$HMARAY_B = explode(' ', $HMARAY[1]);
	 	
	 	$kjjg_arr = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4,$KJJG_5);
	 	
	 	$arr_count = array_count_values($kjjg_arr);
	 	
	 	rsort($arr_count);
	 	
	 	$cfkjjg = 0;
	 	
	 	$kk = array();
	 	
	 	foreach (array_count_values($kjjg_arr) as $k => $v){
	 		if($arr_count[0]==$v){
	 			$cfkjjg = $k;
	 		}else{
	 			$kk[] = $k;
	 		}
	 	}

	 	if($arr_count[0]==2){

	 		if(in_array($cfkjjg,$HMARAY_A) !== false){

	 			if(in_array($kk[0],$HMARAY_B) !== false){

	 				if(in_array($kk[1],$HMARAY_B) !== false){
	 	
	 					if(in_array($kk[2],$HMARAY_B) !== false){
	 		
	 							$ZJZS = $ZJZS+1;

	 					}
	 				}
	 			}
	 		}
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "五星组选30"){
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	
	 	$HMARAY_A = explode(' ', $HMARAY[0]);
	 	
	 	$HMARAY_B = explode(' ', $HMARAY[1]);
	 	
	 	$kjjg_arr = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4,$KJJG_5);
	 	 
	 	$arr_count = array_count_values($kjjg_arr);
	 	 
	 	rsort($arr_count);
	 	 
	 	$cfkjjg = 0;
	 	 
	 	$kk = array();
	 	 
	 	foreach (array_count_values($kjjg_arr) as $k => $v){
	 		if($arr_count[0]==$v){
	 			$kk[] = $k;
	 		}else{
	 			$cfkjjg = $k;
	 		}
	 	}
	 	
	 	if($arr_count[0]==2 && $arr_count[1]==2){
	 	
	 		if(in_array($cfkjjg,$HMARAY_B) !== false){
	 	
	 			if(in_array($kk[0],$HMARAY_A) !== false){
	 	
	 				if(in_array($kk[1],$HMARAY_A) !== false){
	 	
	 						$ZJZS = $ZJZS+1;
	 	
	 				}
	 			}
	 		}
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "五星组选20"){
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	 
	 	$HMARAY_A = explode(' ', $HMARAY[0]);
	 	 
	 	$HMARAY_B = explode(' ', $HMARAY[1]);
	 	 
	 	$kjjg_arr = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4,$KJJG_5);
	 	 
	 	$arr_count = array_count_values($kjjg_arr);
	 	 
	 	rsort($arr_count);
	 	 
	 	$cfkjjg = 0;
	 	 
	 	$kk = array();
	 	 
	 	foreach (array_count_values($kjjg_arr) as $k => $v){
	 		if($arr_count[0]==$v){
	 			$cfkjjg = $k;
	 		}else{
	 			$kk[] = $k;
	 		}
	 	}
	 	
	 	if($arr_count[0]==3){
	 	
	 		if(in_array($cfkjjg,$HMARAY_A) !== false){
	 	
	 			if(in_array($kk[0],$HMARAY_B) !== false){
	 	
	 				if(in_array($kk[1],$HMARAY_B) !== false){
	 	
	 						$ZJZS = $ZJZS+1;

	 				}
	 			}
	 		}
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "五星组选10"){
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 
	 	$HMARAY_A = explode(' ', $HMARAY[0]);
	 
	 	$HMARAY_B = explode(' ', $HMARAY[1]);
	 
	 	$kjjg_arr = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4,$KJJG_5);
	 
	 	$arr_count = array_count_values($kjjg_arr);
	 
	 	rsort($arr_count);
	 
	 	$cfkjjg = 0;
	 
	 	$kk = 0;
	 
	 	foreach (array_count_values($kjjg_arr) as $k => $v){
	 		if($arr_count[0]==$v){
	 			$cfkjjg = $k;
	 		}else{
	 			$kk = $k;
	 		}
	 	}
	 	 
	 	if($arr_count[0]==3 && $arr_count[1]==2){
	 		 
	 		if(in_array($cfkjjg,$HMARAY_A) !== false){
	 			 
	 			if(in_array($kk,$HMARAY_B) !== false){
	 					 
	 					$ZJZS = $ZJZS+1;
	 
	 			}
	 		}
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "五星组选5"){
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 
	 	$HMARAY_A = explode(' ', $HMARAY[0]);
	 
	 	$HMARAY_B = explode(' ', $HMARAY[1]);
	 
	 	$kjjg_arr = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4,$KJJG_5);
	 
	 	$arr_count = array_count_values($kjjg_arr);
	 
	 	rsort($arr_count);
	 
	 	$cfkjjg = 0;
	 
	 	$kk = 0;
	 
	 	foreach (array_count_values($kjjg_arr) as $k => $v){
	 		if($arr_count[0]==$v){
	 			$cfkjjg = $k;
	 		}else{
	 			$kk = $k;
	 		}
	 	}
	 	 
	 	if($arr_count[0]==4){
	 		 
	 		if(in_array($cfkjjg,$HMARAY_A) !== false){
	 			 
	 			if(in_array($kk[0],$HMARAY_B) !== false){
	 				
	 					$ZJZS = $ZJZS+1;
	 
	 			}
	 		}
	 	}
	 }
	 
	 IF($wanfaname['class_name_mini']=="前四直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==4){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
						 
						 IF(STRSTR($HMARAY[3],$KJJG_4) !== false){
						
							 $ZJZS=$ZJZS+1;
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 if($wanfaname['class_name_mini']=="前四直选组合"){
	 	 
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);

 		if(strstr($HMARAY[3], $KJJG_5) !== false){
 			$ZJZS=$ZJZS+1;
 			if(strstr($HMARAY[2], $KJJG_4) !== false){
 				$ZJZS=$ZJZS+1;
 				if(strstr($HMARAY[1], $KJJG_3) !== false){
 					$ZJZS=$ZJZS+1;
 					if(strstr($HMARAY[0], $KJJG_2) !== false){
 						$ZJZS=$ZJZS+1;
 					}
 				}
 			}
 		}
	 	
	 }
	 if($wanfaname['class_name_mini']=="后四直选组合"){
	 
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);

 		if(strstr($HMARAY[3], $KJJG_4) !== false){
 			$ZJZS=$ZJZS+1;
 			if(strstr($HMARAY[2], $KJJG_3) !== false){
 				$ZJZS=$ZJZS+1;
 				if(strstr($HMARAY[1], $KJJG_2) !== false){
 					$ZJZS=$ZJZS+1;
 					if(strstr($HMARAY[0], $KJJG_1) !== false){
 						$ZJZS=$ZJZS+1;
 					}
 				}
 			}
 		}
	 }
	 if($wanfaname['class_name_mini'] == "前四星组选24"){
	 	 
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	 
	 	$arr_count = array_count_values($HMARAY);
	 	 
	 	rsort($arr_count);
	 	 
	 	if($arr_count[0]<=1){
	 
	 		if(strstr($OLD_TZ['tzhm'], $KJJG_1) !== false){
	 				
	 			if(strstr($OLD_TZ['tzhm'], $KJJG_2) !== false){
	 
	 				if(strstr($OLD_TZ['tzhm'], $KJJG_3) !== false){
	 						
	 					if(strstr($OLD_TZ['tzhm'], $KJJG_4) !== false){
	 								
	 							$ZJZS = $ZJZS+1;
	 						}
	 					}
	 				}
	 			}
	 		}
	 	}
	 
	 if($wanfaname['class_name_mini'] == "前四星组选12"){
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 
	 	$HMARAY_A = explode(' ', $HMARAY[0]);
	 
	 	$HMARAY_B = explode(' ', $HMARAY[1]);
	 
	 	$kjjg_arr = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4);
	 
	 	$arr_count = array_count_values($kjjg_arr);
	 
	 	rsort($arr_count);
	 
	 	$cfkjjg = 0;
	 
	 	$kk = array();
	 
	 	foreach (array_count_values($kjjg_arr) as $k => $v){
	 		if($arr_count[0]==$v){
	 			$cfkjjg = $k;
	 		}else{
	 			$kk[] = $k;
	 		}
	 	}
	 	 
	 	if($arr_count[0]==2){
	 		 
	 		if(in_array($cfkjjg,$HMARAY_A) !== false){
	 			 
	 			if(in_array($kk[0],$HMARAY_B) !== false){
	 				 
	 				if(in_array($kk[1],$HMARAY_B) !== false){
	 					 
	 					$ZJZS = $ZJZS+1;
	 
	 				}
	 			}
	 		}
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "前四星组选6"){

	 	$HMARAY = explode(' ', $HMARAY[0]);
	 
	 	$kjjg_arr = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4);
	 
	 	$arr_count = array_count_values($kjjg_arr);
	 
	 	rsort($arr_count);
	 
	 	$kk = array();
	 
	 	foreach (array_count_values($kjjg_arr) as $k => $v){
	 		if($arr_count[0]==$v){
	 			$kk[] = $k;
	 		}
	 	}
	 
	 	if($arr_count[0]==2 && $arr_count[1]==2){
	 
 			if(in_array($kk[0],$HMARAY) !== false){
 					
 				if(in_array($kk[1],$HMARAY) !== false){
 
 					$ZJZS = $ZJZS+1;
 
 				}
 			}
	 		
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "前四星组选4"){
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 
	 	$HMARAY_A = explode(' ', $HMARAY[0]);
	 
	 	$HMARAY_B = explode(' ', $HMARAY[1]);
	 
	 	$kjjg_arr = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4);
	 
	 	$arr_count = array_count_values($kjjg_arr);
	 
	 	rsort($arr_count);
	 
	 	$cfkjjg = 0;
	 
	 	$kk = 0;
	 
	 	foreach (array_count_values($kjjg_arr) as $k => $v){
	 		if($arr_count[0]==$v){
	 			$cfkjjg = $k;
	 		}else{
	 			$kk = $k;
	 		}
	 	}
	 
	 	if($arr_count[0]==3){
	 	 	
	 		if(in_array($cfkjjg,$HMARAY_A) !== false){
	 
	 			if(in_array($kk,$HMARAY_B) !== false){
 
	 					$ZJZS = $ZJZS+1;

	 			}
	 		}
	 	}
	 }
	 IF($wanfaname['class_name_mini']=="后四直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==4){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_2) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_3) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_4) !== false){
						 
						 IF(STRSTR($HMARAY[3],$KJJG_5) !== false){
						
							 $ZJZS=$ZJZS+1;
							 
						 }
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 if($wanfaname['class_name_mini'] == "后四星组选24"){
	 
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 
	 	$arr_count = array_count_values($HMARAY);
	 
	 	rsort($arr_count);
	 
	 	if($arr_count[0]<=1){
	 
	 		if(strstr($OLD_TZ['tzhm'], $KJJG_5) !== false){
	 
	 			if(strstr($OLD_TZ['tzhm'], $KJJG_2) !== false){
	 
	 				if(strstr($OLD_TZ['tzhm'], $KJJG_3) !== false){
	 
	 					if(strstr($OLD_TZ['tzhm'], $KJJG_4) !== false){
	 
	 						$ZJZS = $ZJZS+1;
	 					}
	 				}
	 			}
	 		}
	 	}
	 }
	 
	 if($wanfaname['class_name_mini'] == "前四星组选12"){
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 
	 	$HMARAY_A = explode(' ', $HMARAY[0]);
	 
	 	$HMARAY_B = explode(' ', $HMARAY[1]);
	 
	 	$kjjg_arr = array($KJJG_5,$KJJG_2,$KJJG_3,$KJJG_4);
	 
	 	$arr_count = array_count_values($kjjg_arr);
	 
	 	rsort($arr_count);
	 
	 	$cfkjjg = 0;
	 
	 	$kk = array();
	 
	 	foreach (array_count_values($kjjg_arr) as $k => $v){
	 		if($arr_count[0]==$v){
	 			$cfkjjg = $k;
	 		}else{
	 			$kk[] = $k;
	 		}
	 	}
	 
	 	if($arr_count[0]==2){
	 	 	
	 		if(in_array($cfkjjg,$HMARAY_A) !== false){
	 
	 			if(in_array($kk[0],$HMARAY_B) !== false){
	 					
	 				if(in_array($kk[1],$HMARAY_B) !== false){
	 
	 					$ZJZS = $ZJZS+1;
	 
	 				}
	 			}
	 		}
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "前四星组选6"){
	 
	 	$HMARAY = explode(' ', $HMARAY[0]);
	 
	 	$kjjg_arr = array($KJJG_5,$KJJG_2,$KJJG_3,$KJJG_4);
	 
	 	$arr_count = array_count_values($kjjg_arr);
	 
	 	rsort($arr_count);
	 
	 	$kk = array();
	 
	 	foreach (array_count_values($kjjg_arr) as $k => $v){
	 		if($arr_count[0]==$v){
	 			$kk[] = $k;
	 		}
	 	}
	 
	 	if($arr_count[0]==2 && $arr_count[1]==2){
	 
	 		if(in_array($kk[0],$HMARAY) !== false){
	 
	 			if(in_array($kk[1],$HMARAY) !== false){
	 
	 				$ZJZS = $ZJZS+1;
	 
	 			}
	 		}
	 
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "前四星组选4"){
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 
	 	$HMARAY_A = explode(' ', $HMARAY[0]);
	 
	 	$HMARAY_B = explode(' ', $HMARAY[1]);
	 
	 	$kjjg_arr = array($KJJG_5,$KJJG_2,$KJJG_3,$KJJG_4);
	 
	 	$arr_count = array_count_values($kjjg_arr);
	 
	 	rsort($arr_count);
	 
	 	$cfkjjg = 0;
	 
	 	$kk = 0;
	 
	 	foreach (array_count_values($kjjg_arr) as $k => $v){
	 		if($arr_count[0]==$v){
	 			$cfkjjg = $k;
	 		}else{
	 			$kk = $k;
	 		}
	 	}
	 
	 	if($arr_count[0]==3){
	 	 	
	 		if(in_array($cfkjjg,$HMARAY_A) !== false){
	 
	 			if(in_array($kk,$HMARAY_B) !== false){
	 
	 				$ZJZS = $ZJZS+1;
	 
	 			}
	 		}
	 	}
	 }
	 IF($wanfaname['class_name_mini']=="后三直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==3){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_3) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_4) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_5) !== false){
					 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 if($wanfaname['class_name_mini']=="后三直选和值"){
	 	
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 	
	 	$cont = $KJJG_3+$KJJG_4+$KJJG_5;
	 	
	 	if(in_array($cont, $HMARAY) !== false){
	 		
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="后三直选跨度"){
	 	
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 	
	 	$arr = array($KJJG_3,$KJJG_4,$KJJG_5);
	 	
	 	$cz = max($arr)-min($arr);
	 	
	 	if(in_array($cz, $HMARAY) !== false){
	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="后三直选和值尾数"){
	 	
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 	
	 	$cont = $KJJG_3+$KJJG_4+$KJJG_5;
	 	
	 	$ws = substr($cont, -1);
	 	
	 	if(in_array($ws, $HMARAY) !== false){
	 		 
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 IF($wanfaname['class_name_mini']=="中三直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==3){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_2) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_3) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_4) !== false){
					 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 if($wanfaname['class_name_mini']=="中三直选和值"){
	 	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 	 
	 	$cont = $KJJG_3+$KJJG_4+$KJJG_2;
	 	 
	 	if(in_array($cont, $HMARAY) !== false){
	 
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="中三直选跨度"){
	 	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 	 
	 	$arr = array($KJJG_3,$KJJG_4,$KJJG_2);
	 	 
	 	$cz = max($arr)-min($arr);
	 	 
	 	if(in_array($cz, $HMARAY) !== false){
	 		 
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="中三直选和值尾数"){
	 	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 	 
	 	$cont = $KJJG_3+$KJJG_4+$KJJG_2;
	 	 
	 	$ws = substr($cont, -1);
	 	 
	 	if(in_array($ws, $HMARAY) !== false){
	 	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 IF($wanfaname['class_name_mini']=="前三直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==3){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					 
					 IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
					 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 if($wanfaname['class_name_mini']=="前三直选和值"){
	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	$cont = $KJJG_3+$KJJG_1+$KJJG_2;
	 
	 	if(in_array($cont, $HMARAY) !== false){
	 
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="前三直选跨度"){
	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	$arr = array($KJJG_3,$KJJG_1,$KJJG_2);
	 
	 	$cz = max($arr)-min($arr);
	 
	 	if(in_array($cz, $HMARAY) !== false){
	 	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="前三直选和值尾数"){
	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	$cont = $KJJG_3+$KJJG_1+$KJJG_2;
	 
	 	$ws = substr($cont, -1);
	 
	 	if(in_array($ws, $HMARAY) !== false){
	 	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 IF($wanfaname['class_name_mini']=="后三组选组六"){
		 
		 IF($KJJG_3!=$KJJG_4 && $KJJG_3!=$KJJG_5 && $KJJG_4!=$KJJG_5){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3) !== false){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4) !== false){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5) !== false){
						 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($wanfaname['class_name_mini']=="中三组选组六"){
		 
		 IF($KJJG_3!=$KJJG_2 && $KJJG_3!=$KJJG_4 && $KJJG_4!=$KJJG_2){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2) !== false){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3) !== false){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4) !== false){
						 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($wanfaname['class_name_mini']=="前三组选组六"){
		 
		 IF($KJJG_1!=$KJJG_2 && $KJJG_3!=$KJJG_1 && $KJJG_3!=$KJJG_2){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1) !== false){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2) !== false){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3) !== false){
						 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 IF($wanfaname['class_name_mini']=="后三组选组三"){
		 
		 $IFZS="0";
		 
		 IF($KJJG_3==$KJJG_4 && $KJJG_3!=$KJJG_5 && $KJJG_4!=$KJJG_5){$IFZS="1";}
		 
		 IF($KJJG_3==$KJJG_5 && $KJJG_3!=$KJJG_4 && $KJJG_4!=$KJJG_5){$IFZS="1";}
		 
		 IF($KJJG_5==$KJJG_4 && $KJJG_3!=$KJJG_4 && $KJJG_3!=$KJJG_5){$IFZS="1";}
		 
		 IF($IFZS=="1"){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3) !== false){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4) !== false){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5) !== false){
						 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 IF($wanfaname['class_name_mini']=="中三组选组三"){
		 
		 $IFZS="0";
		 
		 IF($KJJG_3==$KJJG_2 && $KJJG_3!=$KJJG_4 && $KJJG_4!=$KJJG_2){$IFZS="1";}
		 
		 IF($KJJG_3==$KJJG_4 && $KJJG_2!=$KJJG_4 && $KJJG_2!=$KJJG_3){$IFZS="1";}
		 
		 IF($KJJG_2==$KJJG_4 && $KJJG_3!=$KJJG_4 && $KJJG_3!=$KJJG_2){$IFZS="1";}
		 
		 IF($IFZS=="1"){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2) !== false){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3) !== false){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4) !== false){
						 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 IF($wanfaname['class_name_mini']=="前三组选组三"){
		 
		 $IFZS="0";
		 
		 IF($KJJG_1==$KJJG_2 && $KJJG_3!=$KJJG_1 && $KJJG_3!=$KJJG_2){$IFZS="1";}
		 
		 IF($KJJG_1==$KJJG_3 && $KJJG_2!=$KJJG_1 && $KJJG_2!=$KJJG_3){$IFZS="1";}
		 
		 IF($KJJG_2==$KJJG_3 && $KJJG_3!=$KJJG_1 && $KJJG_1!=$KJJG_2){$IFZS="1";}
		 
		 IF($IFZS=="1"){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1) !== false){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2) !== false){
					 
					 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_3) !== false){
						 
						 $ZJZS=$ZJZS+1;
						 
					 }
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 IF($wanfaname['class_name_mini']=="后二直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==2){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_4) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_5) !== false){
				 
					 $ZJZS=$ZJZS+1;
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	if($wanfaname['class_name_mini']=="后二直选和值"){
	 	
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	
	 	$cont = $KJJG_4+$KJJG_5;
	 	
	 	if(in_array($cont, $HMARAY) !== false){
	 		
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="后二直选跨度"){
	 	
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	
	 	$arr = array($KJJG_4,$KJJG_5);
	 	
	 	$cz = max($arr)-min($arr);
	 	
	 	if(in_array($cz, $HMARAY) !== false){
	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="后二直选和值尾数"){
	 	
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	
	 	$cont = $KJJG_4+$KJJG_5;
	 	
	 	$ws = substr($cont, -1);
	 	
	 	if(in_array($ws, $HMARAY) !== false){
	 		 
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 IF($wanfaname['class_name_mini']=="前二直选复式"){
		 
		 $HMARAY=explode(",",$OLD_TZ['tzhm']);
		 
		 IF(COUNT($HMARAY)==2){
			 
			 IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
				 
				 IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
				 
					 $ZJZS=$ZJZS+1;
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 IF($wanfaname['class_name_mini']=="后二组选复式"){
	 		
	 	IF($KJJG_4!=$KJJG_5){
	 
	 		IF(STRSTR($OLD_TZ['tzhm'],$KJJG_4) !== false){
	 				
	 			IF(STRSTR($OLD_TZ['tzhm'],$KJJG_5) !== false){
	 					
	 				$ZJZS=$ZJZS+1;
	 
	 			}
	 				
	 		}
	 
	 	}
	 		
	 }
	 if($wanfaname['class_name_mini']=="前二直选和值"){
	 	 
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	 
	 	$cont = $KJJG_1+$KJJG_2;
	 	 
	 	if(in_array($cont, $HMARAY) !== false){
	 
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="前二直选跨度"){
	 	 
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	 
	 	$arr = array($KJJG_1,$KJJG_2);
	 	 
	 	$cz = max($arr)-min($arr);
	 	 
	 	if(in_array($cz, $HMARAY) !== false){
	 		 
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="前二直选和值尾数"){
	 	 
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	 
	 	$cont = $KJJG_1+$KJJG_2;
	 	 
	 	$ws = substr($cont, -1);
	 	 
	 	if(in_array($ws, $HMARAY) !== false){
	 	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 
	 
	 IF($wanfaname['class_name_mini']=="前二组选复式"){
		 
		 IF($KJJG_1!=$KJJG_2){
			 
			 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_1) !== false){
				 
				 IF(STRSTR($OLD_TZ['tzhm'],$KJJG_2) !== false){
				 
					 $ZJZS=$ZJZS+1;
					 
				 }
				 
			 }
			 
		 }
		 
	 }
	 
	 if($wanfaname['class_name_mini'] == "定位胆"){
	 	
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	
	 	if(strstr($HMARAY[0], $KJJG_1)!==false){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($HMARAY[1], $KJJG_2)!==false){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($HMARAY[2], $KJJG_3)!==false){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($HMARAY[3], $KJJG_4)!==false){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($HMARAY[4], $KJJG_5)!==false){
	 		$ZJZS=$ZJZS+1;
	 	}
	 	
	 }
	 
	 if($wanfaname['class_name_mini']=="三星不定位后三一码"){

	 	if(strstr($OLD_TZ['tzhm'], $KJJG_3) !== false){
	 		
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_4) !== false){
	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_5) !== false){
	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 
	 if($wanfaname['class_name_mini']=="三星不定位中三一码"){
	 
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_3) !== false){
	 
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_4) !== false){
	 		 
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_2) !== false){
	 		 
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 
	 if($wanfaname['class_name_mini']=="三星不定位前三一码"){
	 
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_3) !== false){
	 
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_2) !== false){
	 		 
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_1) !== false){
	 		 
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 
	 if($wanfaname['class_name_mini']=="三星不定位后三二码"){
	 	
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	if(in_array($KJJG_3, $HMARAY) !== false){
	 		
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_3, $HMARAY) !== false){
	 	
	 		if(in_array($KJJG_5,$HMARAY) !== false){
	 	
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_5, $HMARAY) !== false){
	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 	
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	
	 }
	 if($wanfaname['class_name_mini']=="三星不定位中三二码"){
	 	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	if(in_array($KJJG_3, $HMARAY) !== false){
	 
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_3, $HMARAY) !== false){
	 		 
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 			 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 		 
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 			 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	 
	 }
	 if($wanfaname['class_name_mini']=="三星不定位前三二码"){
	 	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	if(in_array($KJJG_3, $HMARAY) !== false){
	 
	 		if(in_array($KJJG_1,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_3, $HMARAY) !== false){
	 		 
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 			 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 		 
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 			 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	 
	 }
	 if($wanfaname['class_name_mini'] == "四星不定位前四一码"){
	 	
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_4) !== false){
	 		 
	 		$ZJZS=$ZJZS+1;
	 	}
	 	
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_3) !== false){
	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_2) !== false){
	 			
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_1) !== false){
	 			
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="四星不定位前四二码"){
	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_3,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 	
	 		if(in_array($KJJG_3,$HMARAY) !== false){
	 	
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 			
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 	
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_3, $HMARAY) !== false){
	 			
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 	
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 
	 }
	 if($wanfaname['class_name_mini']=="四星不定位后四二码"){
	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	if(in_array($KJJG_5, $HMARAY) !== false){
	 
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_5, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_3,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_5, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 		 
	 		if(in_array($KJJG_3,$HMARAY) !== false){
	 			 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 			 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_3, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 			 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 
	 }
	 if($wanfaname['class_name_mini']=="四星不定位前四三码"){
	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}

	 
	 }
	 if($wanfaname['class_name_mini']=="四星不定位后四三码"){
	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	if(in_array($KJJG_5, $HMARAY) !== false){
	 
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 				
	 			if(in_array($KJJG_4,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_5, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 				
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 				
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 
	 
	 }
	 if($wanfaname['class_name_mini'] == "四星不定位后四一码"){
	 	 
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_4) !== false){
	 	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 	 
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_3) !== false){
	 		 
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_2) !== false){
	 	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_5) !== false){
	 	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "五星不定位五星一码"){
	 	
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_1) !== false){
	 			
	 		$ZJZS=$ZJZS+1;
	 	}
	 
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_4) !== false){
	 	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_3) !== false){
	 	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_2) !== false){
	 	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 	if(strstr($OLD_TZ['tzhm'], $KJJG_5) !== false){
	 	 	
	 		$ZJZS=$ZJZS+1;
	 	}
	 }
	 if($wanfaname['class_name_mini']=="五星不定位五星二码"){
	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_3,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 			
	 		if(in_array($KJJG_5,$HMARAY) !== false){
	 	
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 		 
	 		if(in_array($KJJG_3,$HMARAY) !== false){
	 			 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 			 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 			
	 		if(in_array($KJJG_5,$HMARAY) !== false){
	 	
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_3, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 			 
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_3, $HMARAY) !== false){
	 			
	 		if(in_array($KJJG_5,$HMARAY) !== false){
	 	
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if(in_array($KJJG_5, $HMARAY) !== false){
	 			
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 	
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 
	 }
	 
	 if($wanfaname['class_name_mini']=="五星不定位五星三码"){
	 
	 	$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	 
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_4,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_5,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_3,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_4,$HMARAY) !== false){
	 			 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_3,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_5,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_5,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_5,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 			 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_5,$HMARAY) !== false){
	 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_3, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_5,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_4,$HMARAY) !== false){
	 			 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_2, $HMARAY) !== false){
	 	 	
	 		if(in_array($KJJG_4,$HMARAY) !== false){
	 			
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 			 
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 
	 }
	 if($wanfaname['class_name_mini'] == "五星不定位五星四码"){
	 	
	 	$OLD=explode(" ",$OLD_TZ['tzhm']);
	 	
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 			
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 		 	
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 				
	 				if(in_array($KJJG_4,$HMARAY) !== false){
	 	
	 					$ZJZS=$ZJZS+1;
	 				}
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 			
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 	
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 	
	 				if(in_array($KJJG_5,$HMARAY) !== false){
	 					 
	 					$ZJZS=$ZJZS+1;
	 				}
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_5, $HMARAY) !== false){
	 			
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 	
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 	
	 				if(in_array($KJJG_4,$HMARAY) !== false){
	 					 
	 					$ZJZS=$ZJZS+1;
	 				}
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 			
	 		if(in_array($KJJG_5,$HMARAY) !== false){
	 	
	 			if(in_array($KJJG_3,$HMARAY) !== false){
	 	
	 				if(in_array($KJJG_4,$HMARAY) !== false){
	 					 
	 					$ZJZS=$ZJZS+1;
	 				}
	 			}
	 		}
	 	}
	 	if(in_array($KJJG_1, $HMARAY) !== false){
	 			
	 		if(in_array($KJJG_2,$HMARAY) !== false){
	 	
	 			if(in_array($KJJG_5,$HMARAY) !== false){
	 	
	 				if(in_array($KJJG_4,$HMARAY) !== false){
	 					 
	 					$ZJZS=$ZJZS+1;
	 				}
	 			}
	 		}
	 	}
	 }
	
	 if($wanfaname['class_name_mini']=="任二复式"){

	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 		
	 	$RENYISAN=0;
	 		
	 	IF(COUNT($HMARAY)==5){
	 	
	 		IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
	 				
	 			$RENYISAN=$RENYISAN+1;
	 				
	 		}
	 		IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
	 				
	 			$RENYISAN=$RENYISAN+1;
	 				
	 		}
	 		IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
	 				
	 			$RENYISAN=$RENYISAN+1;
	 				
	 		}
	 		IF(STRSTR($HMARAY[3],$KJJG_4) !== false){
	 				
	 			$RENYISAN=$RENYISAN+1;
	 				
	 		}
	 		IF(STRSTR($HMARAY[4],$KJJG_5) !== false){
	 				
	 			$RENYISAN=$RENYISAN+1;
	 				
	 		}
	 	
	 		IF($RENYISAN==2){$ZJZS=1;}
	 		IF($RENYISAN==3){$ZJZS=3;}
	 		IF($RENYISAN==4){$ZJZS=6;}
	 		IF($RENYISAN==5){$ZJZS=10;}
	 	
	 	}
	 }

	 if($wanfaname['class_name_mini'] == "任二组选"){
	 	
	 	$HMARAY=explode(",",$OLD_TZ['tzhm']);
	 	$HMARAY_A = explode(' ', $HMARAY[0]);
	 	$HMARAY_B = explode(' ', $HMARAY[1]);
	 	$RENYISAN=0;
	 	$arr = array(
	 		'万位'=>$KJJG_1,'千位'=>$KJJG_2,'百位'=>$KJJG_3,'十位'=>$KJJG_4,'个位'=>$KJJG_5
	 	);
	 	for ($i=0;$i<count($HMARAY_A);$i++){
	 		foreach ($arr as $key=>$value){
	 			if($HMARAY_A[$i]==$key){
	 				if(count($HMARAY_B)>=2){
	 					IF(STRSTR($HMARAY[1],$value) !== false){
	 					 	
	 						$RENYISAN=$RENYISAN+1;
	 				
	 					}
	 				}
	 			}
	 		}
	 		
	 	}
	 	IF($RENYISAN==2){$ZJZS=1;}
	 	IF($RENYISAN==3){$ZJZS=3;}
	 	IF($RENYISAN==4){$ZJZS=6;}
	 	IF($RENYISAN==5){$ZJZS=10;}
	 	
	 }

	if($wanfaname['class_name_mini'] == "任三复式"){
		$HMARAY=explode(",",$OLD_TZ['tzhm']);
			
		$RENYISAN=0;
			
		IF(COUNT($HMARAY)==5){
		
			IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
					
				$RENYISAN=$RENYISAN+1;
					
			}
			IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					
				$RENYISAN=$RENYISAN+1;
					
			}
			IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
					
				$RENYISAN=$RENYISAN+1;
					
			}
			IF(STRSTR($HMARAY[3],$KJJG_4) !== false){
					
				$RENYISAN=$RENYISAN+1;
					
			}
			IF(STRSTR($HMARAY[4],$KJJG_5) !== false){
					
				$RENYISAN=$RENYISAN+1;
					
			}
		
			IF($RENYISAN==3){$ZJZS=1;}
			IF($RENYISAN==4){$ZJZS=4;}
			IF($RENYISAN==5){$ZJZS=10;}
		
		}
	}
	//哈哈哈哈没有写出来的
	if($wanfaname['class_name_mini'] == "任三组三"){
		$HMARAY=explode(",",$OLD_TZ['tzhm']);
		$HMARAY_A = array_filter(explode(' ', $HMARAY[0]));
		
		$HMARAY_B = explode(' ', $HMARAY[1]);
		 $arr  = array(
			0=>array('万位'=>$KJJG_1,'千位'=>$KJJG_2,'百位'=>$KJJG_3),
		    1=>array('万位'=>$KJJG_1,'千位'=>$KJJG_2,'十位'=>$KJJG_4),
		    2=>array('万位'=>$KJJG_1,'千位'=>$KJJG_2,'个位'=>$KJJG_5),
		    3=>array('万位'=>$KJJG_1,'百位'=>$KJJG_3,'十位'=>$KJJG_4),
		    4=>array('万位'=>$KJJG_1,'百位'=>$KJJG_3,'个位'=>$KJJG_5),
		    5=>array('万位'=>$KJJG_1,'十位'=>$KJJG_4,'个位'=>$KJJG_5),
		    6=>array('千位'=>$KJJG_2,'百位'=>$KJJG_3,'十位'=>$KJJG_4),
		    7=>array('千位'=>$KJJG_2,'百位'=>$KJJG_3,'个位'=>$KJJG_5),
		    8=>array('千位'=>$KJJG_2,'十位'=>$KJJG_4,'个位'=>$KJJG_5),
		    9=>array('百位'=>$KJJG_3,'十位'=>$KJJG_4,'个位'=>$KJJG_5)
		);
		foreach($arr as $v) {
            $position = array_keys($v);
            $con = array_intersect($position,$HMARAY_A);
            sort($con);
            sort($position);
            if($position == $con) {
                if(count(array_intersect($HMARAY_B,$v)) == 2) {
                    $ZJZS = $ZJZS+1;
                }
            }
        }
	}
	if($wanfaname['class_name_mini'] == "任三组六"){
		$HMARAY=explode(",",$OLD_TZ['tzhm']);
		$HMARAY_A = array_filter(explode(' ', $HMARAY[0]));
		
		$HMARAY_B = explode(' ', $HMARAY[1]);
		$arr  = array(
			0=>array('万位'=>$KJJG_1,'千位'=>$KJJG_2,'百位'=>$KJJG_3),
		    1=>array('万位'=>$KJJG_1,'千位'=>$KJJG_2,'十位'=>$KJJG_4),
		    2=>array('万位'=>$KJJG_1,'千位'=>$KJJG_2,'个位'=>$KJJG_5),
		    3=>array('万位'=>$KJJG_1,'百位'=>$KJJG_3,'十位'=>$KJJG_4),
		    4=>array('万位'=>$KJJG_1,'百位'=>$KJJG_3,'个位'=>$KJJG_5),
		    5=>array('万位'=>$KJJG_1,'十位'=>$KJJG_4,'个位'=>$KJJG_5),
		    6=>array('千位'=>$KJJG_2,'百位'=>$KJJG_3,'十位'=>$KJJG_4),
		    7=>array('千位'=>$KJJG_2,'百位'=>$KJJG_3,'个位'=>$KJJG_5),
		    8=>array('千位'=>$KJJG_2,'十位'=>$KJJG_4,'个位'=>$KJJG_5),
		    9=>array('百位'=>$KJJG_3,'十位'=>$KJJG_4,'个位'=>$KJJG_5)
		);
		foreach($arr as $v) {
            $position = array_keys($v);
            $con = array_intersect($position,$HMARAY_A);
            sort($con);
            sort($position);
            if($position == $con) {
                if(count(array_intersect($HMARAY_B,$v)) == 3) {
                    $ZJZS = $ZJZS+1;
                }
            }
        }
	} 
	//哈哈哈哈没有写出来的
	if($wanfaname['class_name_mini'] == "任四复式"){
		$HMARAY=explode(",",$OLD_TZ['tzhm']);
			
		$RENYISAN=0;
			
		IF(COUNT($HMARAY)==5){
		
			IF(STRSTR($HMARAY[0],$KJJG_1) !== false){
					
				$RENYISAN=$RENYISAN+1;
					
			}
			IF(STRSTR($HMARAY[1],$KJJG_2) !== false){
					
				$RENYISAN=$RENYISAN+1;
					
			}
			IF(STRSTR($HMARAY[2],$KJJG_3) !== false){
					
				$RENYISAN=$RENYISAN+1;
					
			}
			IF(STRSTR($HMARAY[3],$KJJG_4) !== false){
					
				$RENYISAN=$RENYISAN+1;
					
			}
			IF(STRSTR($HMARAY[4],$KJJG_5) !== false){
					
				$RENYISAN=$RENYISAN+1;
					
			}
		
			IF($RENYISAN==4){$ZJZS=1;}
			IF($RENYISAN==5){$ZJZS=5;}
		
		}
	}
	 
	if($wanfaname['class_name_mini'] == "趣味一帆风顺"){
		$HMARAY=explode(" ",$OLD_TZ['tzhm']);

		$kjjg = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4,$KJJG_5);
		
		$vare = array_count_values($kjjg);
		foreach ($vare as $k=>$v){
			IF(in_array($k,$HMARAY)){
			
				$ZJZS=$ZJZS+1;
			
			}
		}
		
	}
	if($wanfaname['class_name_mini'] == "趣味好事成双"){
		$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	
		$kjjg = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4,$KJJG_5);
	
		$vare = array_count_values($kjjg);
		foreach ($vare as $k=>$v){
			if ($v==2) {
				if(in_array($k,$HMARAY)){
						
					$ZJZS=$ZJZS+1;
						
				}
			}
			
		}
	}
	if($wanfaname['class_name_mini'] == "趣味三星报喜"){
		$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	
		$kjjg = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4,$KJJG_5);
	
		$vare = array_count_values($kjjg);
		foreach ($vare as $k=>$v){
			if ($v==3) {
				if(in_array($k,$HMARAY)){
	
					$ZJZS=$ZJZS+1;
	
				}
			}
				
		}
	}
	if($wanfaname['class_name_mini'] == "趣味四季发财"){
		$HMARAY=explode(" ",$OLD_TZ['tzhm']);
	
		$kjjg = array($KJJG_1,$KJJG_2,$KJJG_3,$KJJG_4,$KJJG_5);
	
		$vare = array_count_values($kjjg);
		foreach ($vare as $k=>$v){
			if ($v==4) {
				if(in_array($k,$HMARAY)){
	
					$ZJZS=$ZJZS+1;
	
				}
			}
	
		}
	}

	 
	 IF($wanfaname['class_name_mini']=="龙虎万个"){
		 
		 IF($OLD_TZ['tzhm']=="龙" && $KJJG_1>$KJJG_5){$ZJZS=$ZJZS+1;}
		 
		 IF($OLD_TZ['tzhm']=="虎" && $KJJG_1<$KJJG_5){$ZJZS=$ZJZS+1;}
		 
		 IF($OLD_TZ['tzhm']=="和" && $KJJG_1==$KJJG_5){$ZJZS=$ZJZS+1;}
		 
	 }
	 IF($wanfaname['class_name_mini']=="龙虎万千"){
	 		
	 	IF($OLD_TZ['tzhm']=="龙" && $KJJG_1>$KJJG_2){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']=="虎" && $KJJG_1<$KJJG_2){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']=="和" && $KJJG_1==$KJJG_2){$ZJZS=$ZJZS+1;}
	 		
	 }
	 IF($wanfaname['class_name_mini']=="龙虎万百"){
	 		
	 	IF($OLD_TZ['tzhm']=="龙" && $KJJG_1>$KJJG_3){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']=="虎" && $KJJG_1<$KJJG_3){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']=="和" && $KJJG_1==$KJJG_3){$ZJZS=$ZJZS+1;}
	
	 }
	 IF($wanfaname['class_name_mini']=="龙虎万十"){
	 		
	 	IF($OLD_TZ['tzhm']=="龙" && $KJJG_1>$KJJG_4){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']=="虎" && $KJJG_1<$KJJG_4){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']=="和" && $KJJG_1==$KJJG_4){$ZJZS=$ZJZS+1;}
	 		
	 }
	 IF($wanfaname['class_name_mini']=="龙虎千百"){
	 		
	 	IF($OLD_TZ['tzhm']=="龙" && $KJJG_2>$KJJG_3){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']=="虎" && $KJJG_2<$KJJG_3){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']=="和" && $KJJG_2==$KJJG_3){$ZJZS=$ZJZS+1;}
	 }
	 IF($wanfaname['class_name_mini']=="龙虎千十"){
	 		
	 	IF($OLD_TZ['tzhm']=="龙" && $KJJG_2>$KJJG_4){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']=="虎" && $KJJG_2<$KJJG_4){$ZJZS=$ZJZS+1;}
	 		
	 	IF($OLD_TZ['tzhm']=="和" && $KJJG_2==$KJJG_4){$ZJZS=$ZJZS+1;}
	 }
	 IF($wanfaname['class_name_mini']=="龙虎千个"){
	 
	 	IF($OLD_TZ['tzhm']=="龙" && $KJJG_2>$KJJG_5){$ZJZS=$ZJZS+1;}
	 
	 	IF($OLD_TZ['tzhm']=="虎" && $KJJG_2<$KJJG_5){$ZJZS=$ZJZS+1;}
	 
	 	IF($OLD_TZ['tzhm']=="和" && $KJJG_2==$KJJG_5){$ZJZS=$ZJZS+1;}
	 }
	 IF($wanfaname['class_name_mini']=="龙虎百十"){
	 
	 	IF($OLD_TZ['tzhm']=="龙" && $KJJG_3>$KJJG_4){$ZJZS=$ZJZS+1;}
	 
	 	IF($OLD_TZ['tzhm']=="虎" && $KJJG_3<$KJJG_4){$ZJZS=$ZJZS+1;}
	 
	 	IF($OLD_TZ['tzhm']=="和" && $KJJG_3==$KJJG_4){$ZJZS=$ZJZS+1;}
	 }
	 IF($wanfaname['class_name_mini']=="龙虎百个"){
	 
	 	IF($OLD_TZ['tzhm']=="龙" && $KJJG_3>$KJJG_5){$ZJZS=$ZJZS+1;}
	 
	 	IF($OLD_TZ['tzhm']=="虎" && $KJJG_3<$KJJG_5){$ZJZS=$ZJZS+1;}
	 
	 	IF($OLD_TZ['tzhm']=="和" && $KJJG_3==$KJJG_5){$ZJZS=$ZJZS+1;}
	 }
	 IF($wanfaname['class_name_mini']=="龙虎十个"){
	 
	 	IF($OLD_TZ['tzhm']=="龙" && $KJJG_4>$KJJG_5){$ZJZS=$ZJZS+1;}
	 
	 	IF($OLD_TZ['tzhm']=="虎" && $KJJG_4<$KJJG_5){$ZJZS=$ZJZS+1;}
	 
	 	IF($OLD_TZ['tzhm']=="和" && $KJJG_4==$KJJG_5){$ZJZS=$ZJZS+1;}
	 }
	 if($wanfaname['class_name_mini'] == "特殊号前三"){
	 	
	 	if($OLD_TZ['tzhm']=='对子'){
	 		if($KJJG_1 == $KJJG_2 || $KJJG_1 == $KJJG_3 || $KJJG_2 == $KJJG_3){
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='豹子'){
	 		if($KJJG_1 == $KJJG_2 && $KJJG_1 == $KJJG_3 && $KJJG_2 == $KJJG_3){
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='顺子'){
	 		$arr = array($KJJG_1,$KJJG_2,$KJJG_3);
	 		sort($arr);
	 		if($arr[2]-$arr[1]==1){
	 			if ($arr[1]-$arr[0]==1) {
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='半顺'){
	 		$arr = array($KJJG_1,$KJJG_2,$KJJG_3);
	 		sort($arr);
	 		if($arr[2]-$arr[1]==1 || $arr[1]-$arr[0]==1){
	 			
	 				$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='杂六'){
	 		if($KJJG_1 != $KJJG_2 || $KJJG_1 != $KJJG_3 || $KJJG_2 != $KJJG_3){
	 			$arr = array($KJJG_1,$KJJG_2,$KJJG_3);
	 			sort($arr);
	 			if($arr[2]-$arr[1] != 1 || $arr[1]-$arr[0] != 1){
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	
	 }
	 if($wanfaname['class_name_mini'] == "特殊号中三"){
	 	if($OLD_TZ['tzhm']=='对子'){
	 		if($KJJG_4 == $KJJG_2 || $KJJG_4 == $KJJG_3 || $KJJG_2 == $KJJG_3){
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='豹子'){
	 		if($KJJG_4 == $KJJG_2 && $KJJG_4 == $KJJG_3 && $KJJG_2 == $KJJG_3){
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='顺子'){
	 		$arr = array($KJJG_4,$KJJG_2,$KJJG_3);
	 		sort($arr);
	 		if($arr[2]-$arr[1]==1){
	 			if ($arr[1]-$arr[0]==1) {
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='半顺'){
	 		$arr = array($KJJG_4,$KJJG_2,$KJJG_3);
	 		sort($arr);
	 		if($arr[2]-$arr[1]==1 || $arr[1]-$arr[0]==1){
	 		 	
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='杂六'){
	 		if($KJJG_4 != $KJJG_2 || $KJJG_4 != $KJJG_3 || $KJJG_2 != $KJJG_3){
	 			$arr = array($KJJG_4,$KJJG_2,$KJJG_3);
	 			sort($arr);
	 			if($arr[2]-$arr[1] != 1 || $arr[1]-$arr[0] != 1){
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 }
	 if($wanfaname['class_name_mini'] == "特殊号后三"){
	 	if($OLD_TZ['tzhm']=='对子'){
	 		if($KJJG_4 == $KJJG_5 || $KJJG_4 == $KJJG_3 || $KJJG_5 == $KJJG_3){
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='豹子'){
	 		if($KJJG_4 == $KJJG_5 && $KJJG_4 == $KJJG_3 && $KJJG_5 == $KJJG_3){
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='顺子'){
	 		$arr = array($KJJG_4,$KJJG_5,$KJJG_3);
	 		sort($arr);
	 		if($arr[2]-$arr[1]==1){
	 			if ($arr[1]-$arr[0]==1) {
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='半顺'){
	 		$arr = array($KJJG_4,$KJJG_5,$KJJG_3);
	 		sort($arr);
	 		if($arr[2]-$arr[1]==1 || $arr[1]-$arr[0]==1){
	 	
	 			$ZJZS=$ZJZS+1;
	 		}
	 	}
	 	if($OLD_TZ['tzhm']=='杂六'){
	 		if($KJJG_4 != $KJJG_5 || $KJJG_4 != $KJJG_3 || $KJJG_5 != $KJJG_3){
	 			$arr = array($KJJG_4,$KJJG_5,$KJJG_3);
	 			sort($arr);
	 			if($arr[2]-$arr[1] != 1 || $arr[1]-$arr[0] != 1){
	 				$ZJZS=$ZJZS+1;
	 			}
	 		}
	 	}
	 }

	 IF($wanfaname['class_name_mini']=="定位万位"){
		 
	 	$HMARAY = explode(' ', $OLD_TZ['tzhm']);
	 	 
	 	foreach ($HMARAY as $v){
	 
	 		IF($v=="大" && $KJJG_1>4){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="小" && $KJJG_1<5){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="单" && $KJJG_1%2!=0){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="双" && $KJJG_1%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 }
	 IF($wanfaname['class_name_mini']=="定位千位"){
	 		
	 $HMARAY = explode(' ', $OLD_TZ['tzhm']);
	 	 
	 	foreach ($HMARAY as $v){
	 
	 		IF($v=="大" && $KJJG_2>4){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="小" && $KJJG_2<5){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="单" && $KJJG_2%2!=0){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="双" && $KJJG_2%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 }
	 IF($wanfaname['class_name_mini']=="定位百位"){
	 		
	 $HMARAY = explode(' ', $OLD_TZ['tzhm']);
	 	 
	 	foreach ($HMARAY as $v){
	 
	 		IF($v=="大" && $KJJG_3>4){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="小" && $KJJG_3<5){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="单" && $KJJG_3%2!=0){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="双" && $KJJG_3%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 
	 }
	 IF($wanfaname['class_name_mini']=="定位十位"){
	 	 
	 	$HMARAY = explode(' ', $OLD_TZ['tzhm']);
	 	 
	 	foreach ($HMARAY as $v){
	 
	 		IF($v=="大" && $KJJG_4>4){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="小" && $KJJG_4<5){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="单" && $KJJG_4%2!=0){$ZJZS=$ZJZS+1;}
	 		 
	 		IF($v=="双" && $KJJG_4%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 
	 }
	 IF($wanfaname['class_name_mini']=="定位个位"){
	 	
	 	$HMARAY = explode(' ', $OLD_TZ['tzhm']);
	 	
	 	foreach ($HMARAY as $v){
	 		
		 	IF($v=="大" && $KJJG_5>4){$ZJZS=$ZJZS+1;}
		 		
		 	IF($v=="小" && $KJJG_5<5){$ZJZS=$ZJZS+1;}
		 		
		 	IF($v=="单" && $KJJG_5%2!=0){$ZJZS=$ZJZS+1;}
		 		
		 	IF($v=="双" && $KJJG_5%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 		
	 }
	 IF($wanfaname['class_name_mini']=="大小单双总和"){
	 	$HMARAY = explode(' ', $OLD_TZ['tzhm']);
	 	$KJZH = $KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
	 	foreach ($HMARAY as $v){
	 		IF($v=="大" && $KJZH>22){$ZJZS=$ZJZS+1;}
	 		
	 		IF($v=="小" && $KJZH<23){$ZJZS=$ZJZS+1;}
	 		
	 		IF($v=="单" && $KJZH%2!=0){$ZJZS=$ZJZS+1;}
	 		
	 		IF($v=="双" && $KJZH%2==0){$ZJZS=$ZJZS+1;}
	 	}
	 		
	 }
	 IF($wanfaname['class_name_mini']=="大小单双串关"){
	 	$HMARAY = explode(',', $OLD_TZ['tzhm']);
	 	
	 	foreach ($HMARAY as $k=>$v){
	 		$i = $k+1;
	 		$vali = explode(' ', $v);
	 		foreach ($vali as $va){
		 		IF($va=="大" && '$KJJG_'.$i>4){$ZJZS=$ZJZS+1;}
		 
		 		IF($va=="小" && '$KJJG_'.$i<5){$ZJZS=$ZJZS+1;}
		 
		 		IF($va=="单" && '$KJJG_'.$i%2!=0){$ZJZS=$ZJZS+1;}
		 
		 		IF($va=="双" && '$KJJG_'.$i%2==0){$ZJZS=$ZJZS+1;}
	 		}
	 	}
	 
	 }
	 
	 IF($wanfaname['class_name_mini']=="斗牛"){
		 
		 IF($OLD_TZ['tzhm']=="无牛"){
			 
			 $IFWUNIU=0;
			 
			 FOR($N_1=0;$N_1<5;$N_1++){
				 
				 FOR($N_2=0;$N_2<5;$N_2++){
					 
					 FOR($N_3=0;$N_3<5;$N_3++){
						 
						 IF($IFWUNIU==0){
							 
							 IF($N_1!=$N_2 && $N_1!=$N_3 && $N_2!=$N_3){
								 
								 $A_1=SUBSTR($KJJG,$N_1,1);
						 
								 $A_2=SUBSTR($KJJG,$N_2,1);
								 
								 $A_3=SUBSTR($KJJG,$N_3,1);
								 
								 $ZHS=$A_1+$A_2+$A_3;
								 
								 IF($ZHS%10==0){
									 
									 $IFWUNIU=1;
									 
								 }
							 } 	
						 } 
					 }
				 }
				 
			 }
			 
			 IF($IFWUNIU==0){$ZJZS=$ZJZS+1;}
			 
		 }
		 IF($OLD_TZ['tzhm']=="牛一"){
		 	$IFWUNIU=0;
		 	FOR($N_1=0;$N_1<5;$N_1++){
		 		FOR($N_2=0;$N_2<5;$N_2++){
		 			FOR($N_3=0;$N_3<5;$N_3++){
		 				IF($IFWUNIU==0){
		 					IF($N_1!=$N_2 && $N_1!=$N_3 && $N_2!=$N_3){
		 						$A_1=SUBSTR($KJJG,$N_1,1);
		 						$A_2=SUBSTR($KJJG,$N_2,1);
		 						$A_3=SUBSTR($KJJG,$N_3,1);
		 						$ZHS=$A_1+$A_2+$A_3;
		 						IF($ZHS%10==0){
		 							$IFWUNIU=1;
		 						}
		 					}
		 				}
		 			}
		 		}
		 	}
		 	if($IFWUNIU) {
		 		$ZHONGHEZHI=$KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
		 		$ZHONGHEZHI=FLOOR($ZHONGHEZHI-$ZHS);
		 		IF($ZHONGHEZHI>=10){$ZHONGHEZHI=$ZHONGHEZHI-10;}
		 		IF($ZHONGHEZHI==1){$ZJZS=$ZJZS+1;}
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="牛二"){
		 	$IFWUNIU=0;
		 	FOR($N_1=0;$N_1<5;$N_1++){
		 		FOR($N_2=0;$N_2<5;$N_2++){
		 			FOR($N_3=0;$N_3<5;$N_3++){
		 				IF($IFWUNIU==0){
		 					IF($N_1!=$N_2 && $N_1!=$N_3 && $N_2!=$N_3){
		 						$A_1=SUBSTR($KJJG,$N_1,1);
		 						$A_2=SUBSTR($KJJG,$N_2,1);
		 						$A_3=SUBSTR($KJJG,$N_3,1);
		 						$ZHS=$A_1+$A_2+$A_3;
		 						IF($ZHS%10==0){
		 							$IFWUNIU=1;
		 						}
		 					}
		 				}
		 			}
		 		}
		 	}
		 
		 	if($IFWUNIU) {
		 		$ZHONGHEZHI=$KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
		 		$ZHONGHEZHI=FLOOR($ZHONGHEZHI-$ZHS);
		 		IF($ZHONGHEZHI>=10){$ZHONGHEZHI=$ZHONGHEZHI-10;}
		 		IF($ZHONGHEZHI==2){$ZJZS=$ZJZS+1;}
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="牛三"){
		 	$IFWUNIU=0;
		 	FOR($N_1=0;$N_1<5;$N_1++){
		 		FOR($N_2=0;$N_2<5;$N_2++){
		 			FOR($N_3=0;$N_3<5;$N_3++){
		 				IF($IFWUNIU==0){
		 					IF($N_1!=$N_2 && $N_1!=$N_3 && $N_2!=$N_3){
		 						$A_1=SUBSTR($KJJG,$N_1,1);
		 						$A_2=SUBSTR($KJJG,$N_2,1);
		 						$A_3=SUBSTR($KJJG,$N_3,1);
		 						$ZHS=$A_1+$A_2+$A_3;
		 						IF($ZHS%10==0){
		 							$IFWUNIU=1;
		 						}
		 					}
		 				}
		 			}
		 		}
		 	}
		 	if($IFWUNIU) {
		 		$ZHONGHEZHI=$KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
		 		$ZHONGHEZHI=FLOOR($ZHONGHEZHI-$ZHS);
		 		IF($ZHONGHEZHI>=10){$ZHONGHEZHI=$ZHONGHEZHI-10;}
		 		IF($ZHONGHEZHI==3){$ZJZS=$ZJZS+1;}
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="牛四"){
		 	$IFWUNIU=0;
		 	FOR($N_1=0;$N_1<5;$N_1++){
		 		FOR($N_2=0;$N_2<5;$N_2++){
		 			FOR($N_3=0;$N_3<5;$N_3++){
		 				IF($IFWUNIU==0){
		 					IF($N_1!=$N_2 && $N_1!=$N_3 && $N_2!=$N_3){
		 						$A_1=SUBSTR($KJJG,$N_1,1);
		 						$A_2=SUBSTR($KJJG,$N_2,1);
		 						$A_3=SUBSTR($KJJG,$N_3,1);
		 						$ZHS=$A_1+$A_2+$A_3;
		 						IF($ZHS%10==0){
		 							$IFWUNIU=1;
		 						}
		 					}
		 				}
		 			}
		 		}
		 	}
		 	if($IFWUNIU) {
		 		$ZHONGHEZHI=$KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
		 		$ZHONGHEZHI=FLOOR($ZHONGHEZHI-$ZHS);
		 		IF($ZHONGHEZHI>=10){$ZHONGHEZHI=$ZHONGHEZHI-10;}
		 		IF($ZHONGHEZHI==4){$ZJZS=$ZJZS+1;}
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="牛五"){
		 	$IFWUNIU=0;
		 	FOR($N_1=0;$N_1<5;$N_1++){
		 		FOR($N_2=0;$N_2<5;$N_2++){
		 			FOR($N_3=0;$N_3<5;$N_3++){
		 				IF($IFWUNIU==0){
		 					IF($N_1!=$N_2 && $N_1!=$N_3 && $N_2!=$N_3){
		 						$A_1=SUBSTR($KJJG,$N_1,1);
		 						$A_2=SUBSTR($KJJG,$N_2,1);
		 						$A_3=SUBSTR($KJJG,$N_3,1);
		 						$ZHS=$A_1+$A_2+$A_3;
		 						IF($ZHS%10==0){
		 							$IFWUNIU=1;
		 						}
		 					}
		 				}
		 			}
		 		}
		 	}
		 	if($IFWUNIU) {
		 		$ZHONGHEZHI=$KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
		 		$ZHONGHEZHI=FLOOR($ZHONGHEZHI-$ZHS);
		 		IF($ZHONGHEZHI>=10){$ZHONGHEZHI=$ZHONGHEZHI-10;}
		 		IF($ZHONGHEZHI==5){$ZJZS=$ZJZS+1;}
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="牛六"){
		 	$IFWUNIU=0;
		 	FOR($N_1=0;$N_1<5;$N_1++){
		 		FOR($N_2=0;$N_2<5;$N_2++){
		 			FOR($N_3=0;$N_3<5;$N_3++){
		 				IF($IFWUNIU==0){
		 					IF($N_1!=$N_2 && $N_1!=$N_3 && $N_2!=$N_3){
		 						$A_1=SUBSTR($KJJG,$N_1,1);
		 						$A_2=SUBSTR($KJJG,$N_2,1);
		 						$A_3=SUBSTR($KJJG,$N_3,1);
		 						$ZHS=$A_1+$A_2+$A_3;
		 						IF($ZHS%10==0){
		 							$IFWUNIU=1;
		 						}
		 					}
		 				}
		 			}
		 		}
		 	}
		 	if($IFWUNIU) {
		 		$ZHONGHEZHI=$KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
		 		$ZHONGHEZHI=FLOOR($ZHONGHEZHI-$ZHS);
		 		IF($ZHONGHEZHI>=10){$ZHONGHEZHI=$ZHONGHEZHI-10;}
		 		IF($ZHONGHEZHI==6){$ZJZS=$ZJZS+1;}
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="牛七"){
		 	$IFWUNIU=0;
		 	FOR($N_1=0;$N_1<5;$N_1++){
		 		FOR($N_2=0;$N_2<5;$N_2++){
		 			FOR($N_3=0;$N_3<5;$N_3++){
		 				IF($IFWUNIU==0){
		 					IF($N_1!=$N_2 && $N_1!=$N_3 && $N_2!=$N_3){
		 						$A_1=SUBSTR($KJJG,$N_1,1);
		 						$A_2=SUBSTR($KJJG,$N_2,1);
		 						$A_3=SUBSTR($KJJG,$N_3,1);
		 						$ZHS=$A_1+$A_2+$A_3;
		 						IF($ZHS%10==0){
		 							$IFWUNIU=1;
		 						}
		 					}
		 				}
		 			}
		 		}
		 	}
		 	if($IFWUNIU) {
		 		$ZHONGHEZHI=$KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
		 		$ZHONGHEZHI=FLOOR($ZHONGHEZHI-$ZHS);
		 		IF($ZHONGHEZHI>=10){$ZHONGHEZHI=$ZHONGHEZHI-10;}
		 		IF($ZHONGHEZHI==7){$ZJZS=$ZJZS+1;}
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="牛八"){
		 	$IFWUNIU=0;
		 	FOR($N_1=0;$N_1<5;$N_1++){
		 		FOR($N_2=0;$N_2<5;$N_2++){
		 			FOR($N_3=0;$N_3<5;$N_3++){
		 				IF($IFWUNIU==0){
		 					IF($N_1!=$N_2 && $N_1!=$N_3 && $N_2!=$N_3){
		 						$A_1=SUBSTR($KJJG,$N_1,1);
		 						$A_2=SUBSTR($KJJG,$N_2,1);
		 						$A_3=SUBSTR($KJJG,$N_3,1);
		 						$ZHS=$A_1+$A_2+$A_3;
		 						IF($ZHS%10==0){
		 							$IFWUNIU=1;
		 						}
		 					}
		 				}
		 			}
		 		}
		 	}
		 	if($IFWUNIU) {
		 		$ZHONGHEZHI=$KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
		 		$ZHONGHEZHI=FLOOR($ZHONGHEZHI-$ZHS);
		 		IF($ZHONGHEZHI>=10){$ZHONGHEZHI=$ZHONGHEZHI-10;}
		 		IF($ZHONGHEZHI==8){$ZJZS=$ZJZS+1;}
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="牛九"){
		 	$IFWUNIU=0;
		 	FOR($N_1=0;$N_1<5;$N_1++){
		 		FOR($N_2=0;$N_2<5;$N_2++){
		 			FOR($N_3=0;$N_3<5;$N_3++){
		 				IF($IFWUNIU==0){
		 					IF($N_1!=$N_2 && $N_1!=$N_3 && $N_2!=$N_3){
		 						$A_1=SUBSTR($KJJG,$N_1,1);
		 						$A_2=SUBSTR($KJJG,$N_2,1);
		 						$A_3=SUBSTR($KJJG,$N_3,1);
		 						$ZHS=$A_1+$A_2+$A_3;
		 						IF($ZHS%10==0){
		 							$IFWUNIU=1;
		 						}
		 					}
		 				}
		 			}
		 		}
		 	}
		 	if($IFWUNIU) {
		 		$ZHONGHEZHI=$KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
		 		$ZHONGHEZHI=FLOOR($ZHONGHEZHI-$ZHS);
		 		IF($ZHONGHEZHI>=10){$ZHONGHEZHI=$ZHONGHEZHI-10;}
		 		IF($ZHONGHEZHI==9){$ZJZS=$ZJZS+1;}
		 	}
		 }
		 IF($OLD_TZ['tzhm']=="牛牛"){
		 	$IFWUNIU=0;
		 	FOR($N_1=0;$N_1<5;$N_1++){
		 		FOR($N_2=0;$N_2<5;$N_2++){
		 			FOR($N_3=0;$N_3<5;$N_3++){
		 				IF($IFWUNIU==0){
		 					IF($N_1!=$N_2 && $N_1!=$N_3 && $N_2!=$N_3){
		 						$A_1=SUBSTR($KJJG,$N_1,1);
		 						$A_2=SUBSTR($KJJG,$N_2,1);
		 						$A_3=SUBSTR($KJJG,$N_3,1);
		 						$ZHS=$A_1+$A_2+$A_3;
		 						IF($ZHS%10==0){
		 							$IFWUNIU=1;
		 						}
		 					}
		 				}
		 			}
		 		}
		 	}
		 	if($IFWUNIU) {
		 		$ZHONGHEZHI=$KJJG_1+$KJJG_2+$KJJG_3+$KJJG_4+$KJJG_5;
		 		$ZHONGHEZHI=FLOOR($ZHONGHEZHI-$ZHS);
		 		IF($ZHONGHEZHI>=10){$ZHONGHEZHI=$ZHONGHEZHI-10;}
		 		IF($ZHONGHEZHI==0){$ZJZS=$ZJZS+1;}
		 	}
		 }
	 }
	 

	 //结算中奖金额并且删除投注数据表转移到已结算表
	 
	 //定义试玩账号和内部账号  区分写入表
	 
	 $USER_CL=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='".$OLD_TZ['username']."'")->fetch(PDO::FETCH_ASSOC);
	 
	 IF($USER_CL['nbzh']==1 || $USER_CL['swzh']==1){
		 
		 $MYSQL_NAME="kkty_touzhu_list_sw";
		 
	 }ELSE{
		 
		 $MYSQL_NAME="kkty_touzhu_list_ok";
		 
	 }
	 
	 //取出中奖金额
	 
	 IF($OLD_TZ['nbzh']==1){$TZMS_LH=1;}
	 
	 IF($OLD_TZ['nbzh']==2){$TZMS_LH=10;}
	 
	 IF($OLD_TZ['nbzh']==3){$TZMS_LH=100;}
	 
	 //中奖金额算法注释   投注赔率 除以2 乘以单注金额 乘以 中奖注数 除以 投注模式 （赔率*单注金额*中奖注数/投注模式）
	 $ZJJE=$OLD_TZ['dqpl']*$OLD_TZ['dzje']*$ZJZS/$TZMS_LH;
	 if($wanfaname['class_name_mini']=="五星直选组合"){
	 	$pl = explode('|', $OLD_TZ['dqpl']);
	 	if($ZJZS==5){$ZJJE=($pl[0]+$pl[1]+$pl[2]+$pl[3]+$pl[4])*$OLD_TZ['dzje']/$TZMS_LH;}
	 	if($ZJZS==4){$ZJJE=($pl[1]+$pl[2]+$pl[3]+$pl[4])*$OLD_TZ['dzje']/$TZMS_LH;}
	 	if($ZJZS==3){$ZJJE=($pl[2]+$pl[3]+$pl[4])*$OLD_TZ['dzje']/$TZMS_LH;}
	 	if($ZJZS==2){$ZJJE=($pl[3]+$pl[4])*$OLD_TZ['dzje']/$TZMS_LH;}
	 	if($ZJZS==1){$ZJJE=$pl[4]*$OLD_TZ['dzje']/$TZMS_LH;}
	 }
	 if($wanfaname['class_name_mini']=="前四直选组合" || $wanfaname['class_name_mini']=="后四直选组合"){
	 	$pl = explode('|', $OLD_TZ['dqpl']);
	 	if($ZJZS==4){$ZJJE=($pl[0]+$pl[1]+$pl[2]+$pl[3])*$OLD_TZ['dzje']/$TZMS_LH;}
	 	if($ZJZS==3){$ZJJE=($pl[1]+$pl[2]+$pl[3])*$OLD_TZ['dzje']/$TZMS_LH;}
	 	if($ZJZS==2){$ZJJE=($pl[2]+$pl[3])*$OLD_TZ['dzje']/$TZMS_LH;}
	 	if($ZJZS==1){$ZJJE=($pl[3])*$OLD_TZ['dzje']/$TZMS_LH;}
	 }
	
	
	 //转移投注注单
	 
	 $MYSQL_ZHIXING_YUJU_A="`id`,`czid`,`qihao`,`tzhm`,`tzje`,`dzje`,`tzzs`,`username`,`tzhje`,`zjje`,`ifqs`,`wfid`,`dqpl`,`xzfd`,`fdje`,`kjjg`,`zjzs`,`nbzh`,`tz_time`";
	 
	 $MYSQL_ZHIXING_YUJU_B="'".$OLD_TZ['id']."','".$OLD_TZ['czid']."','".$OLD_TZ['qihao']."','".$OLD_TZ['tzhm']."','".$OLD_TZ['tzje']."','".$OLD_TZ['dzje']."','".$OLD_TZ['tzzs']."','".$OLD_TZ['username']."','".$OLD_TZ['tzhje']."','{$ZJJE}','1','".$OLD_TZ['wfid']."','".$OLD_TZ['dqpl']."','".$OLD_TZ['xzfd']."','".$OLD_TZ['fdje']."','{$KJJG}','{$ZJZS}','".$OLD_TZ['nbzh']."','".$OLD_TZ['tz_time']."'";
	 
	 
	  try{ 
		$db_pdo_link->beginTransaction(); 
		$db_pdo_link->exec("INSERT INTO `{$MYSQL_NAME}` ($MYSQL_ZHIXING_YUJU_A) VALUES ($MYSQL_ZHIXING_YUJU_B)");
	 
		$db_pdo_link->exec("DELETE FROM `kkty_touzhu_list_no` WHERE id={$TZID}");
		 
		//判断中奖金额大于0.001 大于的话给用户增加金额
		 
		IF($ZJJE>0.001)
		{
			 
			$db_pdo_link->exec("UPDATE kkty_username SET `je`=`je` + '{$ZJJE}',`zjzje`=`zjzje`+'{$ZJJE}' WHERE id={$USER_CL['id']}");	
		}
		//发送消息
		$CZNMSD=$db_pdo_link->query("SELECT * FROM kkty_caipai_list WHERE id={$OLD_TZ['czid']}")->fetch(PDO::FETCH_ASSOC);
		 
		IF($CZNMSD['cp_name_new']==""){$CZNMSD['cp_name_new']=$CZNMSD['cp_name_old'];}
		 
		USER_FASONG($USER_CL['username'],"您投注的彩种：【{$CZNMSD['cp_name_new']}】第：【{$OLD_TZ['qihao']}】已开奖，中奖金额：【{$ZJJE}】元！");
		
		$db_pdo_link->commit(); 
		return true;
	 }catch(PDOException $e)
	 {
		$db_pdo_link->rollBack();
		return false;
	 } 
}

FUNCTION NumFromDesc($n1,$n2,$n3){

    if($n1==0)
        $n1=10;
    if($n2==0)
        $n2=10;
    if($n3==0)
        $n3=10;
    $nums = array($n1,$n2,$n3);

    sort($nums);

    $nfd="杂六";
    $isbs=false;
    $isdz=false;
    for($i=0;$i<3;$i++){
        $t1 = $nums[$i];


        if ($i == 2) {
            $t2 = $nums[0];
        } else {
            $t2 = $nums[$i + 1];
        }
        if ($t1 == $t2) {
            if ($isdz) {
                $nfd = "豹子";
                break;
            }
            $isdz = true;
            $nfd = "对子";
        } elseif (!$isdz && ($t1 - $t2 == 1 || $t1 - $t2 == -1 || $t1 - $t2 == 9 || $t1 - $t2 == -9)) {// 判断半顺
            if ($isbs
            && ($nums[2] - $nums[0] == 2 || $nums[2] - $nums[0] == -2
                    || $nums[2] - $nums[0] == 9 || $nums[2] - $nums[0] == -9)) {// 判断顺子
                $nfd = "顺子";
                break;
            }
            $isbs = true;
            $nfd = "半顺";
        }
    }
    return $nfd;
}
//-------------------------------------------时时彩彩种类结算----------------------------------------------------------//


//---------------------代理提成结算----------------------------------------------------

/**
 ** $USER [string 投注的会员名字]
 ** $TZJE [string 投注的金额]
 ** $DL [string 是否是代理]
**/

 FUNCTION DAILIJIESUAN($USER,$true_je,$QIHAO,$czid,$xjrens='xjrens>=0',$consumer=''){
    
	/* global $db_pdo_link;
	 
	 if(!$consumer) $consumer = $USER;
	 
	 //$DLTZJE = $db_pdo_link->query("SELECT *FROM kkty_touzhu_list_no WHERE qihao='{$QIHAO}' AND username='{$USER}'"  )->fetch(PDO::FETCH_ASSOC);
	 
	 $CHAXUN=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='{$USER}' AND {$xjrens}"  )->fetch(PDO::FETCH_ASSOC);
	 
	 IF($CHAXUN['tjr'] != ''){
	 	static $i=0;
	 	try {
	 		$db_pdo_link->beginTransaction();
	 		$one_1 = $db_pdo_link->query("SELECT * FROM kkty_username WHERE username='".$CHAXUN['tjr']."' AND dl=1")->fetch(PDO::FETCH_ASSOC);
			if($i==0){
				$DHUJD = $true_je/100*($one_1['fandian']-0);
			}else{
	 			$DHUJD = $true_je/100*($one_1['fandian']-$CHAXUN['fandian']);
			}
	 		//$db_pdo_link->exec("UPDATE `kkty_username` SET `je`=`je`+'{$DHUJD}' WHERE `id`={$one_1['id']}");
	 		$cur_time = time();
	 		
	 		$db_pdo_link->exec("INSERT INTO `kkty_agent_balance` (`agent`,`balance`,`consumer`,`higher_agent`,`czid`,`qihao`,`true_je`,`add_time`) VALUES ('{$CHAXUN['tjr']}',{$DHUJD},'{$consumer}','{$USER}','{$czid}','{$QIHAO}',{$true_je},'{$cur_time}')");
	 		$db_pdo_link->commit();
	 		//递归结算上级代理的钱
	 		IF($one_1['tjr']!="")
	 		{
	 			$i++;
	 			DAILIJIESUAN($CHAXUN['tjr'],$true_je,$QIHAO,$czid,$DL='xjrens>0',$consumer);
	 		}
	 		
	 	}catch (PDOException $e){
	 		$db_pdo_link->rollBack();
	 		return false;
	 	}
	 	
	 } */
	 
	 
	 
	 /* $dltzq = 0;
	 if($DLTZJE){
		 foreach ($DLTZJE as $dltz){
		 	$dltzq += $dltz['tzje'];
		 }
	 }

	 IF($CHAXUN['tjr'] != '')  //有推荐人/上级代理的情况下
	 {
		 try
		 {
			$db_pdo_link->beginTransaction(); 

			$ONE_1=$db_pdo_link->query("SELECT * FROM kkty_username WHERE username='".$CHAXUN['tjr']."' AND dl=1")->fetch(PDO::FETCH_ASSOC); 

			 $DHUJD=$true_je/100*($ONE_1['fandian']-$CHAXUN['fandian'])+$dltzq/100*$ONE_1['fandian'];

			 $db_pdo_link->exec("UPDATE `kkty_username` SET `je`=`je` + '{$DHUJD}' WHERE `id`={$ONE_1['id']}");
			 
			 $cur_time = time();
			 
			 $db_pdo_link->exec("INSERT INTO `kkty_agent_balance` (`agent`,`balance`,`consumer`,`higher_agent`,`czid`,`qihao`,`true_je`,`add_time`) VALUES ('{$CHAXUN['tjr']}',{$DHUJD},'{$consumer}','{$USER}','{$czid}','{$QIHAO}',{$true_je},'{$cur_time}')");
			 
			 $db_pdo_link->commit();
			 //递归结算上级代理的钱
			 IF($ONE_1['tjr']!="")
			 {
				DAILIJIESUAN($CHAXUN['tjr'],$true_je,$QIHAO,$czid,$DL='1',$consumer);
			 }

		 }catch(PDOException $e)
		 {
			
		 } 
	 } */
} 
//---------------------代理提成结算----------------------------------------------------


//会员消息发送
FUNCTION USER_FASONG($USER,$TEST){
	 
	 GLOBAL $db_pdo_link;
	 
	 $TIMES=TIME();
	 
	 $MYSQL_ZIDUAN="`username`,`test`,`xx_time`,`ifdq`";
	 
	 $MYSQL_NEIRON="'{$USER}','{$TEST}','{$TIMES}','0'";
	 
	 $db_pdo_link->exec("INSERT INTO `kkty_xiaoxi` ($MYSQL_ZIDUAN) VALUES ($MYSQL_NEIRON)");
	 
}


$OVERTIME=TIME();

$HDSHHD=$OVERTIME-$OPENTIME;

ECHO RAND(1000,99999)."</BR>".$HDSHHD;


?>
